Project

General

Profile

Feature #4481 » ssl_client_ca_test.diff

ohai (Ippei Obayashi), 03/08/2011 02:56 AM

View differences:

test/openssl/test_ssl.rb
ctx.key = @svr_key
ctx.tmp_dh_callback = proc { DHParam }
ctx.verify_mode = verify_mode
ctx.client_ca = [@ca_cert]
ctx_proc.call(ctx) if ctx_proc
Socket.do_not_reverse_lookup = true
......
ssl.close
called = nil
client_ca_from_server = nil
ctx = OpenSSL::SSL::SSLContext.new
ctx.client_cert_cb = Proc.new{ |sslconn|
called = true
client_ca_from_server = sslconn.client_ca
[@cli_cert, @cli_key]
}
sock = TCPSocket.new("127.0.0.1", port)
......
ssl.sync_close = true
ssl.connect
assert(called)
assert_equal([@ca], client_ca_from_server)
ssl.puts("foo")
assert_equal("foo\n", ssl.gets)
ssl.close
(2-2/2)