Support server-side secure test.

pull/6010/head
vjpai 9 years ago
parent ed25a33eb2
commit cf36f858d6
  1. 5
      src/ruby/qps/client.rb
  2. 3
      src/ruby/qps/server.rb

@ -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
@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
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

Loading…
Cancel
Save