From f82a30d90a9a2cf82cb7b441119275e3412abe72 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Tue, 10 Mar 2015 14:17:33 -0700 Subject: Use ssl name override if it's in the channel argument --- include/grpc++/channel_arguments.h | 2 +- src/cpp/client/secure_credentials.cc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/grpc++/channel_arguments.h b/include/grpc++/channel_arguments.h index b649ba23b8..8d338c654e 100644 --- a/include/grpc++/channel_arguments.h +++ b/include/grpc++/channel_arguments.h @@ -66,7 +66,7 @@ class ChannelArguments { void SetChannelArgs(grpc_channel_args* channel_args) const; private: - friend class Channel; + friend class SecureCredentials; friend class testing::ChannelArgumentsTest; // TODO(yangg) implement copy and assign diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc index 5eb5c54794..47f645c1b6 100644 --- a/src/cpp/client/secure_credentials.cc +++ b/src/cpp/client/secure_credentials.cc @@ -54,7 +54,8 @@ class SecureCredentials GRPC_FINAL : public Credentials { grpc_channel_args channel_args; args.SetChannelArgs(&channel_args); return std::shared_ptr(new Channel( - target, + args.GetSslTargetNameOverride().empty() + ? target : args.GetSslTargetNameOverride(), grpc_secure_channel_create(c_creds_, target.c_str(), &channel_args))); } -- cgit v1.2.3