diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-25 21:23:22 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-25 21:23:22 +0000 |
commit | ab9cd02f256ac9206299b91062f6decef3f1cc69 (patch) | |
tree | 6c9fbbc38aa23ec3fe6c9da14a0cd8402c5346d9 /test | |
parent | dec31ef3eb73d066f504c63af01b1655da48ae91 (diff) |
* test/openssl/test_pair.rb: add a test ensuring that the default DH
callback is used when no DH callback is specified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/openssl/test_pair.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/openssl/test_pair.rb b/test/openssl/test_pair.rb index 6357cdc818..a8df74d821 100644 --- a/test/openssl/test_pair.rb +++ b/test/openssl/test_pair.rb @@ -283,6 +283,29 @@ module OpenSSL::TestPairM serv.close if serv && !serv.closed? end + def test_connect_without_setting_dh_callback + ctx2 = OpenSSL::SSL::SSLContext.new + ctx2.ciphers = "DH" + sock1, sock2 = tcp_pair + s2 = OpenSSL::SSL::SSLSocket.new(sock2, ctx2) + accepted = s2.accept_nonblock(exception: false) + + ctx1 = OpenSSL::SSL::SSLContext.new + ctx1.ciphers = "DH" + s1 = OpenSSL::SSL::SSLSocket.new(sock1, ctx1) + t = Thread.new { s1.connect } + + accept = s2.accept + assert_equal s1, t.value + assert accept + ensure + s1.close if s1 + s2.close if s2 + sock1.close if sock1 + sock2.close if sock2 + accepted.close if accepted.respond_to?(:close) + end + def test_ecdh_callback called = false ctx2 = OpenSSL::SSL::SSLContext.new |