C++ separate endpoint and SSL server name in client.

31 views
Skip to first unread message

gs...@outlook.com

unread,
Apr 30, 2019, 9:27:09 AM4/30/19
to grpc.io
Is it possible in GRPC C++ to separate the endpoint used in the TCP connection from the server name that is verified by SSL?

The simple case for an SSL client connection setup is this:

auto channel = grpc::CreateChannel("myhost.domain:50051", grpc::SslCredentials(grpc::SslCredentialsOptions()));


The host name "myhost.domain" is used to make the TCP connection and is used by SSL to verify the servers certificate.

I would like to connect to  a TCP address as endpoint (e.g. "10.1.2.3:50051") and to let SSL verify that the server name in the certificate is "myhost.domain".
Is this possible and how ?

Thanks

Muxi Yan

unread,
May 1, 2019, 1:21:39 PM5/1/19
to grpc.io

gs...@outlook.com

unread,
May 2, 2019, 2:06:26 AM5/2/19
to grpc.io
Yes this seems to solve the problem, but the comments say:
should never be used in production

What is the reason? 
Is this option unsafe or unstable?

Thanks
Guido 

Alexander Polcyn

unread,
May 8, 2019, 1:33:26 PM5/8/19
to grpc.io
It might be interesting to follow the conversation in https://github.com/grpc/grpc/pull/10529, which explains some of the motivation for why this is discouraged in production.
Reply all
Reply to author
Forward
0 new messages