summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/net/ftp/test_ftp.rb13
-rw-r--r--test/net/http/test_https.rb7
2 files changed, 20 insertions, 0 deletions
diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb
index 36292f181a..98322fdd57 100644
--- a/test/net/ftp/test_ftp.rb
+++ b/test/net/ftp/test_ftp.rb
@@ -1755,6 +1755,7 @@ EOF
server = TCPServer.new(SERVER_ADDR, 0)
port = server.addr[1]
commands = []
+ session_reused_for_data_connection = nil
binary_data = (0..0xff).map {|i| i.chr}.join * 4 * 3
@thread = Thread.start do
sock = server.accept
@@ -1793,6 +1794,7 @@ EOF
conn = OpenSSL::SSL::SSLSocket.new(conn, ctx)
conn.sync_close = true
conn.accept
+ session_reused_for_data_connection = conn.session_reused?
binary_data.scan(/.{1,1024}/nm) do |s|
conn.print(s)
end
@@ -1823,6 +1825,11 @@ EOF
assert_match(/\A(PORT|EPRT) /, commands.shift)
assert_equal("RETR foo\r\n", commands.shift)
assert_equal(nil, commands.shift)
+ # 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.
+ if OpenSSL::OPENSSL_LIBRARY_VERSION !~ /OpenSSL 1.1.0h/
+ assert_equal(true, session_reused_for_data_connection)
+ end
ensure
ftp.close
end
@@ -1832,6 +1839,7 @@ EOF
server = TCPServer.new(SERVER_ADDR, 0)
port = server.addr[1]
commands = []
+ session_reused_for_data_connection = nil
binary_data = (0..0xff).map {|i| i.chr}.join * 4 * 3
@thread = Thread.start do
sock = server.accept
@@ -1869,6 +1877,7 @@ EOF
conn = OpenSSL::SSL::SSLSocket.new(conn, ctx)
conn.sync_close = true
conn.accept
+ session_reused_for_data_connection = conn.session_reused?
binary_data.scan(/.{1,1024}/nm) do |s|
conn.print(s)
end
@@ -1900,6 +1909,10 @@ EOF
assert_match(/\A(PASV|EPSV)\r\n/, commands.shift)
assert_equal("RETR foo\r\n", commands.shift)
assert_equal(nil, commands.shift)
+ # FIXME: The new_session_cb is known broken for clients in OpenSSL 1.1.0h.
+ if OpenSSL::OPENSSL_LIBRARY_VERSION !~ /OpenSSL 1.1.0h/
+ assert_equal(true, session_reused_for_data_connection)
+ end
ensure
ftp.close
end
diff --git a/test/net/http/test_https.rb b/test/net/http/test_https.rb
index a5182a1fe9..c1d486470a 100644
--- a/test/net/http/test_https.rb
+++ b/test/net/http/test_https.rb
@@ -63,6 +63,10 @@ class TestNetHTTPS < Test::Unit::TestCase
end
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/
+
http = Net::HTTP.new("localhost", config("port"))
http.use_ssl = true
http.cert_store = TEST_STORE
@@ -83,6 +87,9 @@ class TestNetHTTPS < Test::Unit::TestCase
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/
+
http = Net::HTTP.new("localhost", config("port"))
http.use_ssl = true
http.cert_store = TEST_STORE