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

Support server-side secure test.

parent ed25a33e
No related branches found
No related tags found
No related merge requests found
...@@ -60,13 +60,13 @@ class BenchmarkClient ...@@ -60,13 +60,13 @@ class BenchmarkClient
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::Credentials.new(certs[0]) cred = GRPC::Core::ChannelCredentials.new(certs[0])
else else
p 'Unsupported to use non-test CA (TBD)' p 'Unsupported to use non-test CA (TBD)'
exit exit
end end
if config.security_params.server_host_override if config.security_params.server_host_override
p 'Unsupported to use severt host override (TBD)' p 'Unsupported to use server host override (TBD)'
exit exit
end end
else else
...@@ -79,7 +79,6 @@ class BenchmarkClient ...@@ -79,7 +79,6 @@ class BenchmarkClient
@done = false @done = false
(0..config.client_channels-1).each do |i| (0..config.client_channels-1).each do |i|
Thread.new { Thread.new {
stub = ''
gtsr = Grpc::Testing::SimpleRequest gtsr = Grpc::Testing::SimpleRequest
gtpt = Grpc::Testing::PayloadType gtpt = Grpc::Testing::PayloadType
gtp = Grpc::Testing::Payload gtp = Grpc::Testing::Payload
......
...@@ -66,7 +66,8 @@ class BenchmarkServer ...@@ -66,7 +66,8 @@ class BenchmarkServer
def initialize(config, port) def initialize(config, port)
if config.security_params if config.security_params
certs = load_test_certs certs = load_test_certs
cred = GRPC::Core::Credentials.new(certs[0]) cred = GRPC::Core::ServerCredentials.new(
nil, [{private_key: certs[1], cert_chain: certs[2]}], false)
else else
cred = :this_port_is_insecure cred = :this_port_is_insecure
end end
......
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