aboutsummaryrefslogtreecommitdiffstats
path: root/test/net/http/test_https.rb
diff options
context:
space:
mode:
authorKarol Bucek <kares@users.noreply.github.com>2022-04-20 06:01:02 +0200
committergit <svn-admin@ruby-lang.org>2022-04-20 13:01:08 +0900
commitcf73cf5981802f2bcc30aba07914acf4286cda5a (patch)
tree9094cfece3e22e71a1339c6692529b990f3d845f /test/net/http/test_https.rb
parentfa2df520bcaaf3957db0489f1237311f091ac08d (diff)
downloadruby-cf73cf5981802f2bcc30aba07914acf4286cda5a.tar.gz
[ruby/net-http] Feature detect to make net/http usable with JRuby
Handle missing session_new_cb= and do not call session_cache_mode=, as JRuby SSL does not support these methods. https://github.com/ruby/net-http/commit/3237ef4d8c
Diffstat (limited to 'test/net/http/test_https.rb')
-rw-r--r--test/net/http/test_https.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/net/http/test_https.rb b/test/net/http/test_https.rb
index f4f1959a0e..72a69af1a5 100644
--- a/test/net/http/test_https.rb
+++ b/test/net/http/test_https.rb
@@ -152,12 +152,14 @@ class TestNetHTTPS < Test::Unit::TestCase
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
@@ -301,7 +303,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