Hello,

I have a problem related to certificates / SSL.

I've taken the files from:
https://github.com/grpc/grpc/tree/master/examples/python/auth/credentials

In my nodejs server application I wrote:

http2
  .createSecureServer(
    {
      key: readFileSync("localhost.key", "utf8"),
      cert: readFileSync("localhost.crt", "utf8"),
      allowHTTP1: true,
    },
    handler
  )
  .listen(8443, () => {
    stdout.write("The server is listening on https://localhost:8443\n";);
  });

In my C++ client application I wrote:

grpc::SslCredentialsOptions ssl_options;
std::ifstream t0("root.crt");
std::stringstream buffer0;
buffer0 << t0.rdbuf();
ssl_options.pem_root_certs = buffer0.str();
std::ifstream t1("localhost.crt");
std::stringstream buffer1;
buffer1 << t1.rdbuf();
ssl_options.pem_cert_chain = buffer1.str();
std::ifstream t2("localhost.key");
std::stringstream buffer2;
buffer2 << t2.rdbuf();
ssl_options.pem_private_key = buffer2.str();
auto channel_creds = grpc::SslCredentials(grpc::SslCredentialsOptions());
OctantsClient client(
grpc::CreateCustomChannel(target_str, channel_creds, channelArgs));

When I run my client after starting up the server I get these errors:

WARNING: All log messages before absl::InitializeLog() is called are
written to STDERR
E0000 00:00:1716361898.830114   17196 ssl_transport_security.cc:1653]
Handshake failed with fatal error SSL_ERROR_SSL: error:1000007d:SSL
routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED.
E0000 00:00:1716361898.863037   17196 ssl_transport_security.cc:1653]
Handshake failed with fatal error SSL_ERROR_SSL: error:1000007d:SSL
routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED.
14: failed to connect to all addresses; last error: UNKNOWN: ipv4:
127.0.0.1:8443: Ssl handshake failed: SSL_ERROR_SSL: error:1000007d:SSL
routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED

What's wrong?

-- 
Dipl.-Ing. Dr. Claus D. Volko, BSc
http://www.cdvolko.net/

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CAGEeFATohVcTCh7xhoam3z4krS2GOAh7fCHmg5ZcnE2HXUiE-g%40mail.gmail.com.

Reply via email to