I am getting error as In Server: "16437 ssl_transport_security.c:1288] No match found for server name: 0.0.0.0." In Client: "security_connector.c:532] Peer name 0.0.0.0 is not in peer certificate" How to configure this IP or hostname(localhost) in certificate? I have checked in grpc as well as in https://github.com/CJLove/grpc-playground/blob/master/certs/create.sh <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2FCJLove%2Fgrpc-playground%2Fblob%2Fmaster%2Fcerts%2Fcreate.sh&sa=D&sntz=1&usg=AFQjCNG3tBVUIGb3gjUgY8sXcjFXkGsGfw> Both are giving same error. Please help me.
On Wednesday, February 10, 2016 at 5:02:14 AM UTC+5:30, Chaitanya Gangwar wrote: > > thanks a lot. Its working now. :) > > On Tuesday, 9 February 2016 15:10:01 UTC-8, Michael Larson wrote: >> >> the domain name you access has to match what's in the cert. you can use >> a hosts file entry to fake it for testing >> >> On Tue, Feb 9, 2016 at 3:07 PM, Chaitanya Gangwar <chaitany...@gmail.com> >> wrote: >> >>> Hi Yang, >>> >>> Sorry i am not able to understand what do you mean by "server name from >>> the certificate". I have generated key and certificate using openssl >>> library. My server is running on a unix box and on the same box i am >>> running client, so in client code i am passing "localhost" as server ip. >>> Does certificate contain server name ? Sorry if my question is too naive. >>> >>> Thanks >>> Chaitanya >>> >>> On Tuesday, 9 February 2016 14:56:50 UTC-8, Yang Gao wrote: >>>> >>>> Assuming everything else is correct, you may need to do this: >>>> https://github.com/grpc/grpc/blob/master/test/cpp/util/create_test_channel.cc#L71 >>>> >>>> to tell grpc the server's name from the certificate (like >>>> www.example.com). Otherwise grpc will just try to find whether your >>>> server's cert has 127.0.0.1 in it and complains if not. >>>> >>>> On Tue, Feb 9, 2016 at 2:40 PM, Chaitanya Gangwar < >>>> chaitany...@gmail.com> wrote: >>>> >>>>> Hi, >>>>> >>>>> I want to setup a ssl based connection between server and client. But >>>>> it is failing in handshake. Below are my code changes. Can anybody please >>>>> help what i am missing here. >>>>> >>>>> >>>>> *Error :On Server Side:* >>>>> E0209 14:35:29.561829549 31835 ssl_transport_security.c:1221] No >>>>> match found for server name: 127.0.0.1. >>>>> >>>>> *On client Side:* >>>>> E0209 14:35:29.573967763 31850 security_connector.c:496] Peer name >>>>> 127.0.0.1 is not in peer certificate >>>>> E0209 14:35:29.574000838 31850 handshake.c:129] Error >>>>> checking peer. >>>>> E0209 14:35:29.574008068 31850 secure_channel_create.c:102] Secure >>>>> handshake failed with error 1. >>>>> >>>>> *Server :* >>>>> std::string server_address("0.0.0.0:50051"); >>>>> >>>>> grpc::SslServerCredentialsOptions::PemKeyCertPair pkcp = {key, cert}; >>>>> >>>>> grpc::SslServerCredentialsOptions ssl_opts; >>>>> ssl_opts.pem_root_certs = ""; >>>>> ssl_opts.pem_key_cert_pairs.push_back(pkcp); >>>>> >>>>> builder.AddListeningPort(server_address, >>>>> grpc::SslServerCredentials(ssl_opts)); >>>>> >>>>> *Client :* >>>>> grpc::SslCredentialsOptions ssl_opts; >>>>> ssl_opts.pem_root_certs = cert; >>>>> >>>>> GreeterClient greeter( >>>>> grpc::CreateChannel("127.0.0.1:50051", >>>>> grpc::SslCredentials(ssl_opts))); >>>>> >>>>> >>>>> Thanks >>>>> Chaitanya >>>>> >>>>> -- >>>>> 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+u...@googlegroups.com. >>>>> To post to this group, send email to grp...@googlegroups.com. >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/grpc-io/23cee0af-025e-4671-9866-333019c1fafb%40googlegroups.com >>>>> >>>>> <https://groups.google.com/d/msgid/grpc-io/23cee0af-025e-4671-9866-333019c1fafb%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 grpc-io+u...@googlegroups.com. >>> To post to this group, send email to grp...@googlegroups.com. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/grpc-io/27428628-2240-411f-ad78-6afe5e182b78%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/grpc-io/27428628-2240-411f-ad78-6afe5e182b78%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 grpc-io+unsubscr...@googlegroups.com. To post to this group, send email to grpc-io@googlegroups.com. 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/7eecc1a1-a788-4f7b-aaf6-326580f28b18%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.