class SslTestService

a test service that checks the cert of its peer

Public Instance Methods

a_bidi_rpc(requests, call) click to toggle source
# File src/ruby/spec/client_auth_spec.rb, line 82
def a_bidi_rpc(requests, call)
  check_peer_cert(call)
  requests.each { |r| p r }
  [EchoMsg.new, EchoMsg.new]
end
a_client_streaming_rpc(call) click to toggle source
# File src/ruby/spec/client_auth_spec.rb, line 71
def a_client_streaming_rpc(call)
  check_peer_cert(call)
  call.each_remote_read.each { |r| p r }
  EchoMsg.new
end
a_server_streaming_rpc(_, call) click to toggle source
# File src/ruby/spec/client_auth_spec.rb, line 77
def a_server_streaming_rpc(_, call)
  check_peer_cert(call)
  [EchoMsg.new, EchoMsg.new]
end
an_rpc(req, call) click to toggle source
# File src/ruby/spec/client_auth_spec.rb, line 66
def an_rpc(req, call)
  check_peer_cert(call)
  req
end
check_peer_cert(call) click to toggle source
# File src/ruby/spec/client_auth_spec.rb, line 61
def check_peer_cert(call)
  error_msg = "want:\n#{client_cert}\n\ngot:\n#{call.peer_cert}"
  fail(error_msg) unless call.peer_cert == client_cert
end