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
91 91
    ctx.key = @svr_key
92 92
    ctx.tmp_dh_callback = proc { DHParam }
93 93
    ctx.verify_mode = verify_mode
94
    ctx.client_ca = [@ca_cert]
94 95
    ctx_proc.call(ctx) if ctx_proc
95 96

  
96 97
    Socket.do_not_reverse_lookup = true
......
264 265
      ssl.close
265 266

  
266 267
      called = nil
268
      client_ca_from_server = nil
267 269
      ctx = OpenSSL::SSL::SSLContext.new
268 270
      ctx.client_cert_cb = Proc.new{ |sslconn|
269 271
        called = true
272
        client_ca_from_server = sslconn.client_ca
270 273
        [@cli_cert, @cli_key]
271 274
      }
272 275
      sock = TCPSocket.new("127.0.0.1", port)
......
274 277
      ssl.sync_close = true
275 278
      ssl.connect
276 279
      assert(called)
280
      assert_equal([@ca], client_ca_from_server)
277 281
      ssl.puts("foo")
278 282
      assert_equal("foo\n", ssl.gets)
279 283
      ssl.close