From 56794708d2cf9dc5dec3e5662aa7114a43a4ccdf Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Tue, 27 Jan 2015 18:36:19 -0800 Subject: [PATCH] add Compute engine credential to tips client. --- examples/tips/client_main.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/tips/client_main.cc b/examples/tips/client_main.cc index f4a3b09601e..23cabd15548 100644 --- a/examples/tips/client_main.cc +++ b/examples/tips/client_main.cc @@ -36,6 +36,7 @@ #include #include #include +#include #include #include "examples/tips/client.h" @@ -55,11 +56,15 @@ int main(int argc, char** argv) { snprintf(host_port, host_port_buf_size, "%s:%d", FLAGS_server_host.c_str(), FLAGS_server_port); + std::unique_ptr creds = + grpc::CredentialsFactory::ComputeEngineCredentials(); std::shared_ptr channel( - grpc::CreateTestChannel(host_port, - FLAGS_server_host, - true, // enable SSL - true)); // use prod roots + grpc::CreateTestChannel( + host_port, + FLAGS_server_host, + true, // enable SSL + true, // use prod roots + creds)); grpc::examples::tips::Client client(channel); grpc::Status s = client.CreateTopic("test");