Skip to content
Snippets Groups Projects
Commit 56794708 authored by Chen Wang's avatar Chen Wang
Browse files

add Compute engine credential to tips client.

parent 3b56a57b
No related branches found
No related tags found
No related merge requests found
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <google/gflags.h> #include <google/gflags.h>
#include <grpc++/channel_interface.h> #include <grpc++/channel_interface.h>
#include <grpc++/create_channel.h> #include <grpc++/create_channel.h>
#include <grpc++/credentials.h>
#include <grpc++/status.h> #include <grpc++/status.h>
#include "examples/tips/client.h" #include "examples/tips/client.h"
...@@ -55,11 +56,15 @@ int main(int argc, char** argv) { ...@@ -55,11 +56,15 @@ int main(int argc, char** argv) {
snprintf(host_port, host_port_buf_size, "%s:%d", FLAGS_server_host.c_str(), snprintf(host_port, host_port_buf_size, "%s:%d", FLAGS_server_host.c_str(),
FLAGS_server_port); FLAGS_server_port);
std::unique_ptr<grpc::Credentials> creds =
grpc::CredentialsFactory::ComputeEngineCredentials();
std::shared_ptr<grpc::ChannelInterface> channel( std::shared_ptr<grpc::ChannelInterface> channel(
grpc::CreateTestChannel(host_port, grpc::CreateTestChannel(
FLAGS_server_host, host_port,
true, // enable SSL FLAGS_server_host,
true)); // use prod roots true, // enable SSL
true, // use prod roots
creds));
grpc::examples::tips::Client client(channel); grpc::examples::tips::Client client(channel);
grpc::Status s = client.CreateTopic("test"); grpc::Status s = client.CreateTopic("test");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment