Skip to content
Snippets Groups Projects
Commit d9389a84 authored by vjpai's avatar vjpai
Browse files

Support secure client

parent cf36f858
Branches
Tags
No related merge requests found
...@@ -57,17 +57,17 @@ end ...@@ -57,17 +57,17 @@ end
class BenchmarkClient class BenchmarkClient
def initialize(config) def initialize(config)
opts = {}
if config.security_params if config.security_params
if config.security_params.use_test_ca if config.security_params.use_test_ca
certs = load_test_certs certs = load_test_certs
cred = GRPC::Core::ChannelCredentials.new(certs[0]) cred = GRPC::Core::ChannelCredentials.new(certs[0])
else else
p 'Unsupported to use non-test CA (TBD)' cred = GRPC::Core::ChannelCredentials.new()
exit
end end
if config.security_params.server_host_override if config.security_params.server_host_override
p 'Unsupported to use server host override (TBD)' opts[GRPC::Core::Channel::SSL_TARGET] =
exit config.security_params.server_host_override
end end
else else
cred = :this_channel_is_insecure cred = :this_channel_is_insecure
...@@ -96,7 +96,7 @@ class BenchmarkClient ...@@ -96,7 +96,7 @@ class BenchmarkClient
end end
gtbss = Grpc::Testing::BenchmarkService::Stub gtbss = Grpc::Testing::BenchmarkService::Stub
st = config.server_targets st = config.server_targets
stub = gtbss.new(st[i % st.length], cred) stub = gtbss.new(st[i % st.length], cred, **opts)
case config.rpc_type case config.rpc_type
when :UNARY when :UNARY
unary_ping_ponger(req,stub,config,waiter) unary_ping_ponger(req,stub,config,waiter)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment