Did you pass a real certificate and private key to PemKeyCertPair? If you used "a", "b" that's your problem.
On Nov 16, 2016 03:47, "AK" <[email protected]> wrote: > I know nothing about SSL/TLS and am trying to use SSL/TLS channel in gRPC > by following instructions found online. > Here is the server code: > > std::string server_address("0.0.0.0:50051"); > GreeterServiceImpl service; > > grpc::SslServerCredentialsOptions::PemKeyCertPair pkcp ={"a","b"}; > grpc::SslServerCredentialsOptions ssl_opts; > ssl_opts.pem_root_certs=""; > ssl_opts.pem_key_cert_pairs.push_back(pkcp); > > std::shared_ptr<grpc::ServerCredentials> creds; > creds = grpc::SslServerCredentials(ssl_opts); > > ServerBuilder builder; > builder.AddListeningPort(server_address, creds); > builder.RegisterService(&service); > std::unique_ptr<Server> server(builder.BuildAndStart()); > > The server won't start and terminates with following error. > > E1115 13:00:55.657846941 17129 ssl_transport_security.c:636] Invalid > cert chain file. > E1115 13:00:55.657936436 17129 security_connector.c:830] Handshaker > factory creation failed with TSI_INVALID_ARGUMENT. > E1115 13:00:55.657954952 17129 server_secure_chttp2.c:344] > {"created":"@1479243655.657946821","description":"Unable to create secure > server with credentials of type Ssl.","file":"src/core/ext/ > transport/chttp2/server/secure/server_secure_chttp2.c" > ,"file_line":242,"security_status":1} > Server listening on 0.0.0.0:50051 > Segmentation fault (core dumped) > > Any help would be appreciated. > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/grpc-io. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/grpc-io/e8597c77-c857-4b00-ae7e-2cb207df857f%40googlegroups.com > <https://groups.google.com/d/msgid/grpc-io/e8597c77-c857-4b00-ae7e-2cb207df857f%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CADiuDATK7WVtO0LTnLY36Ru2hN_LH0dWddKdrao-vXcuf%2BKMWw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
