Git Product home page Git Product logo

Comments (9)

mrdulin avatar mrdulin commented on July 26, 2024 6

@jhump Thanks for reply. I tried -insecure flags, but still got same error.

☁  grpc-go-cnode [master] grpcurl localhost:3000 list -insecure                  
Failed to dial target host "localhost:3000": x509: certificate signed by unknown authority

server logs:

2020/08/28 12:38:50 http: TLS handshake error from [::1]:57784: remote error: tls: bad certificate

So, I want to try -cacert flag. How should I use this flag? Which certificate should be used?

UPDATE:

-insecure flag works fine. Pay attention to the order of the parts of the command

 grpcurl [flags] [address] [list|describe] [symbol]
☁  grpc-go-cnode [master] grpcurl -insecure localhost:3000 list 
grpc.health.v1.Health
grpc.reflection.v1alpha.ServerReflection
topic.TopicService
user.UserService

-cacert flag works fine too. Example:

☁  grpc-go-cnode [master] grpcurl -cacert=./assets/server.crt localhost:3000 list 
grpc.health.v1.Health
grpc.reflection.v1alpha.ServerReflection
topic.TopicService
user.UserService

from grpcurl.

jhump avatar jhump commented on July 26, 2024 1

@gugahoi, correct. If you want to verify the self-signed cert (vs. just trusting any server cert), you would add it to your set of trusted root certs with the -cacert option.

from grpcurl.

brandonros avatar brandonros commented on July 26, 2024

-insecure

from grpcurl.

gugahoi avatar gugahoi commented on July 26, 2024

This is actually ignoring the handshake instead of accepting certificates. I assume the cacert option the the correct way about this but unsure?

from grpcurl.

mrdulin avatar mrdulin commented on July 26, 2024

same issue for self-signed certificates generated by below shell script:

#!/bin/sh

echo "generating credentials and private key for server and client..."
openssl genrsa -out ./assets/server.key 2048

openssl req -new -x509 -days 3650 \
  -subj "/C=GB/L=China/O=grpo-server/CN=localhost" \
  -key ./assets/server.key -out ./assets/server.crt

openssl genrsa -out ./assets/client.key 2048

openssl req -new -x509 -days 3650 \
  -subj "/C=GB/L=China/O=grpo-client/CN=localhost" \
  -key ./assets/client.key -out ./assets/client.crt

from grpcurl.

jhump avatar jhump commented on July 26, 2024

@mrdulin, did you read the above comments and why the issue is closed? This is expected behavior. You have to configure grpcurl to either not check the cert (-insecure) or to trust it (-cacert).

from grpcurl.

sharooksubana avatar sharooksubana commented on July 26, 2024

I am also facing same issue -insecure works fine but I wanted to verify the self-signed cert can anyone give the good example how to use the -cacert flag and from where should I get the certificate

from grpcurl.

sharooksubana avatar sharooksubana commented on July 26, 2024

hi, Can anyone tell me how to use -cacert and which certificate to submit its been 2 months since I have stuck with it

from grpcurl.

cavator avatar cavator commented on July 26, 2024

i grpcurl -cacert=ca.pem -d='{"id":""}' user-service:443 GetUser
still getting
x509: certificate signed by unknown authority
any help?

from grpcurl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.