diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2016-08-30 02:31:02 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2016-08-30 10:37:27 +0900 |
commit | 135f25653353edf1a7a7c960b3c7979b500cf1d6 (patch) | |
tree | 3e77d5ff980dcce5d3c914469df90c8158c255da /test | |
parent | b72957c1bc6bed62312abcb4b13b2acb08ffc0d2 (diff) | |
download | ruby-openssl-135f25653353edf1a7a7c960b3c7979b500cf1d6.tar.gz |
test/test_ssl: fix test_alpn_protocol_selection_cancel again
's2.connect' can block indefinitely depending on the version of OpenSSL.
Since the point of the test case is to check the failure path on ALPN
protocol selection callback, that is called on the server side, just
avoid blocking with SSLSocket#connect_nonblock on the client side. The
callback is called just after receiving the Client Hello so calling
SSLSocket#connect_nonblock once should be sufficient.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_ssl.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test_ssl.rb b/test/test_ssl.rb index 12f70224..628e0652 100644 --- a/test/test_ssl.rb +++ b/test/test_ssl.rb @@ -1123,9 +1123,9 @@ if OpenSSL::OPENSSL_VERSION_NUMBER >= 0x10002000 ssl2 = OpenSSL::SSL::SSLSocket.new(sock2, ctx2) t = Thread.new { - assert_handshake_error { ssl2.connect } + ssl2.connect_nonblock(exception: false) } - assert_raise(TypeError) { ssl1.accept } + assert_raise_with_message(TypeError, /nil/) { ssl1.accept } t.join ensure sock1&.close |