aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/util/create_test_channel.cc
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-02-21 22:45:35 -0800
committerGravatar Craig Tiller <ctiller@google.com>2015-02-23 09:58:22 -0800
commit47c83fdaf71ca5072d0ab37322b37586d23f5ceb (patch)
tree808ca8183045d5e770eebe4eee31ca907ead1f56 /test/cpp/util/create_test_channel.cc
parent8b131922438d96579cb315777ca980e094883496 (diff)
Credentials prototyping
- Remove CredentialsFactory as it's unnecessary - Effectively make Credentials a channel factory, allowing different credential types to create different channel types - this gives us a hook so that InsecureCredentials can at runtime instantiate a different kind of channel as required - giving us a way of generating an openssl free version of grpc++. - Server credentials not touched yet, but they'll need to be updated.
Diffstat (limited to 'test/cpp/util/create_test_channel.cc')
-rw-r--r--test/cpp/util/create_test_channel.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/test/cpp/util/create_test_channel.cc b/test/cpp/util/create_test_channel.cc
index b0472d32a9..278172f6ff 100644
--- a/test/cpp/util/create_test_channel.cc
+++ b/test/cpp/util/create_test_channel.cc
@@ -61,12 +61,10 @@ std::shared_ptr<ChannelInterface> CreateTestChannel(
const std::unique_ptr<Credentials>& creds) {
ChannelArguments channel_args;
if (enable_ssl) {
- const char* roots_certs =
- use_prod_roots ? "" : test_root_cert;
+ const char* roots_certs = use_prod_roots ? "" : test_root_cert;
SslCredentialsOptions ssl_opts = {roots_certs, "", ""};
- std::unique_ptr<Credentials> channel_creds =
- CredentialsFactory::SslCredentials(ssl_opts);
+ std::unique_ptr<Credentials> channel_creds = SslCredentials(ssl_opts);
if (!server.empty() && !override_hostname.empty()) {
channel_args.SetSslTargetNameOverride(override_hostname);
@@ -74,12 +72,11 @@ std::shared_ptr<ChannelInterface> CreateTestChannel(
const grpc::string& connect_to =
server.empty() ? override_hostname : server;
if (creds.get()) {
- channel_creds =
- CredentialsFactory::ComposeCredentials(creds, channel_creds);
+ channel_creds = ComposeCredentials(creds, channel_creds);
}
return CreateChannel(connect_to, channel_creds, channel_args);
} else {
- return CreateChannel(server, channel_args);
+ return CreateChannel(server, InsecureCredentials(), channel_args);
}
}