grpc-java icon indicating copy to clipboard operation
grpc-java copied to clipboard

gRPC SSL Examples

Open megapowers opened this issue 11 years ago • 4 comments

Hi,

Please advise on where I can find java examples on client-server authentication for SSL?

Thank you.

megapowers avatar Aug 20 '15 10:08 megapowers

Please take a look at the SECURITY.md

madongfly avatar Aug 20 '15 15:08 madongfly

Hi,

With regard to this statement, "If the issuing certificate authority for a server is not known to the client then a similar process should be followed on the client to load it so that it may validate the certificate issued to the server.".

What does "similar process should be followed on the client to load it?" means?

I have tried to install the cert manually on my client's java trust store (cacert) but the following error keep appearing:

Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certific ation path to requested target at sun.security.validator.PKIXValidator.doBuild(Unknown Source) at sun.security.validator.PKIXValidator.engineValidate(Unknown Source) at sun.security.validator.Validator.validate(Unknown Source) at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source) at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source) at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source) ... 25 more

Any advice will be appreciated. Thank you.

megapowers avatar Aug 20 '15 17:08 megapowers

In that document, we give the example of loading the certificate chain and key for a Server, loading the certificate on client is very similar, see this test for a concrete example.

madongfly avatar Aug 20 '15 17:08 madongfly

Hi,

Thanks for the help, it seems that the SSL handshake is successful when the client try to establish a connection to the server.

megapowers avatar Aug 21 '15 09:08 megapowers