aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Yang Gao <yangg@google.com>2015-03-10 14:17:33 -0700
committerGravatar Yang Gao <yangg@google.com>2015-03-10 14:17:33 -0700
commitf82a30d90a9a2cf82cb7b441119275e3412abe72 (patch)
tree9cb654aa12e5c8ed7b748a68a729588b7084cbf8
parente0e8edfeda1f7061915bd04fd5e2f28a31064a5c (diff)
Use ssl name override if it's in the channel argument
-rw-r--r--include/grpc++/channel_arguments.h2
-rw-r--r--src/cpp/client/secure_credentials.cc3
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<ChannelInterface>(new Channel(
- target,
+ args.GetSslTargetNameOverride().empty()
+ ? target : args.GetSslTargetNameOverride(),
grpc_secure_channel_create(c_creds_, target.c_str(), &channel_args)));
}