summaryrefslogtreecommitdiff
path: root/test/net/http/test_https_proxy.rb
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2025-12-13 17:30:21 +0900
committergit <svn-admin@ruby-lang.org>2025-12-15 06:08:39 +0000
commit700487ce21f0991fb5d4042707d12b2966670f1e (patch)
treeb14a293cc95a31575860ef5994b1b39d51273b94 /test/net/http/test_https_proxy.rb
parenta2dc4d7faa61a80837f5ea80cfe02f82a489ca89 (diff)
[ruby/net-http] Refactor HTTPS tests
This contains various improvements in tests for openssl integration: - Remove DHE parameters from test servers. OpenSSL is almost always compiled with ECC support nowadays and will prefer ECDHE over DHE. - Remove an outdated omission for a bug in OpenSSL 1.1.0h released in 2018. None of our CI systems use this specific OpenSSL version. - Use top-level return to skip tests if openssl is unavailable. - Refactor tests for Net::HTTP#verify_callback. https://github.com/ruby/net-http/commit/35c1745a26
Diffstat (limited to 'test/net/http/test_https_proxy.rb')
-rw-r--r--test/net/http/test_https_proxy.rb16
1 files changed, 3 insertions, 13 deletions
diff --git a/test/net/http/test_https_proxy.rb b/test/net/http/test_https_proxy.rb
index f4c6aa0b6a..237c16e64d 100644
--- a/test/net/http/test_https_proxy.rb
+++ b/test/net/http/test_https_proxy.rb
@@ -5,14 +5,10 @@ rescue LoadError
end
require 'test/unit'
+return unless defined?(OpenSSL::SSL)
+
class HTTPSProxyTest < Test::Unit::TestCase
def test_https_proxy_authentication
- begin
- OpenSSL
- rescue LoadError
- omit 'autoload problem. see [ruby-dev:45021][Bug #5786]'
- end
-
TCPServer.open("127.0.0.1", 0) {|serv|
_, port, _, _ = serv.addr
client_thread = Thread.new {
@@ -50,12 +46,6 @@ class HTTPSProxyTest < Test::Unit::TestCase
end
def test_https_proxy_ssl_connection
- begin
- OpenSSL
- rescue LoadError
- omit 'autoload problem. see [ruby-dev:45021][Bug #5786]'
- end
-
TCPServer.open("127.0.0.1", 0) {|tcpserver|
ctx = OpenSSL::SSL::SSLContext.new
ctx.key = OpenSSL::PKey.read(read_fixture("server.key"))
@@ -91,4 +81,4 @@ class HTTPSProxyTest < Test::Unit::TestCase
assert_join_threads([client_thread, server_thread])
}
end
-end if defined?(OpenSSL)
+end