diff options
Diffstat (limited to 'test/net/http/test_https.rb')
-rw-r--r-- | test/net/http/test_https.rb | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/test/net/http/test_https.rb b/test/net/http/test_https.rb index 4dc9f1b026..6b3171d265 100644 --- a/test/net/http/test_https.rb +++ b/test/net/http/test_https.rb @@ -137,7 +137,7 @@ class TestNetHTTPS < Test::Unit::TestCase def test_session_reuse # FIXME: The new_session_cb is known broken for clients in OpenSSL 1.1.0h. # See https://github.com/openssl/openssl/pull/5967 for details. - skip if OpenSSL::OPENSSL_LIBRARY_VERSION =~ /OpenSSL 1.1.0h/ + omit if OpenSSL::OPENSSL_LIBRARY_VERSION.include?('OpenSSL 1.1.0h') http = Net::HTTP.new(HOST, config("port")) http.use_ssl = true @@ -148,23 +148,26 @@ class TestNetHTTPS < Test::Unit::TestCase # support session resuse. Limiting the version to the TLSv1.2 stack allows # this test to continue to work on LibreSSL 3.2+. LibreSSL may eventually # support session reuse, but there are no current plans to do so. - http.ssl_version = :TLSv1 + http.ssl_version = :TLSv1_2 end http.start - assert_equal false, http.instance_variable_get(:@socket).io.session_reused? + session_reused = http.instance_variable_get(:@socket).io.session_reused? + assert_false session_reused unless session_reused.nil? # can not detect re-use under JRuby http.get("/") http.finish http.start - assert_equal true, http.instance_variable_get(:@socket).io.session_reused? + session_reused = http.instance_variable_get(:@socket).io.session_reused? + assert_true session_reused unless session_reused.nil? # can not detect re-use under JRuby assert_equal $test_net_http_data, http.get("/").body http.finish end def test_session_reuse_but_expire # FIXME: The new_session_cb is known broken for clients in OpenSSL 1.1.0h. - skip if OpenSSL::OPENSSL_LIBRARY_VERSION =~ /OpenSSL 1.1.0h/ + omit if OpenSSL::OPENSSL_LIBRARY_VERSION.include?('OpenSSL 1.1.0h') + omit if OpenSSL::OPENSSL_LIBRARY_VERSION.include?('OpenSSL 3.2.') http = Net::HTTP.new(HOST, config("port")) http.use_ssl = true @@ -179,7 +182,7 @@ class TestNetHTTPS < Test::Unit::TestCase http.get("/") socket = http.instance_variable_get(:@socket).io - assert_equal false, socket.session_reused? + assert_equal false, socket.session_reused?, "NOTE: OpenSSL library version is #{OpenSSL::OPENSSL_LIBRARY_VERSION}" http.finish end @@ -301,7 +304,7 @@ class TestNetHTTPS < Test::Unit::TestCase ex = assert_raise(OpenSSL::SSL::SSLError){ http.request_get("/") {|res| } } - re_msg = /\ASSL_connect returned=1 errno=0 |SSL_CTX_set_max_proto_version/ + re_msg = /\ASSL_connect returned=1 errno=0 |SSL_CTX_set_max_proto_version|No appropriate protocol/ assert_match(re_msg, ex.message) end |