diff --git a/test/open-uri/test_ssl.rb b/test/open-uri/test_ssl.rb index d56ca86fa1..fa40f6db65 100644 --- a/test/open-uri/test_ssl.rb +++ b/test/open-uri/test_ssl.rb @@ -170,8 +170,9 @@ class TestOpenURISSL } end -end if defined?(OpenSSL) +end if defined?(OpenSSL::TestUtils) +if defined?(OpenSSL::TestUtils) # mkdir demoCA demoCA/private demoCA/newcerts # touch demoCA/index.txt # echo 00 > demoCA/serial @@ -385,3 +386,5 @@ TIvZKDovHJ3UV163xaECQEVQR2ZW6SHZQA6vP/IFd6vnCECXiCpRs36GsLIDLm02 P0ZCl31aopNsBcKLiy2v1X116XDwLSHjuc9NmsSX4nk= -----END RSA PRIVATE KEY----- End + +end diff --git a/test/webrick/test_httpproxy.rb b/test/webrick/test_httpproxy.rb index 304762c465..501bb4cbe5 100644 --- a/test/webrick/test_httpproxy.rb +++ b/test/webrick/test_httpproxy.rb @@ -123,7 +123,7 @@ class TestWEBrickHTTPProxy < Test::Unit::TestCase nil, nil, OpenSSL::Digest::SHA1.new ) return cert - end + end if defined?(OpenSSL::TestUtils) def test_connect # Testing CONNECT to proxy server @@ -172,7 +172,7 @@ class TestWEBrickHTTPProxy < Test::Unit::TestCase } } } - end if defined?(OpenSSL) + end if defined?(OpenSSL::TestUtils) def test_upstream_proxy # Testing GET or POST through the upstream proxy server @@ -240,7 +240,7 @@ class TestWEBrickHTTPProxy < Test::Unit::TestCase assert_equal(3, proxy_handler_called, up_log.call + log.call) assert_equal(3, request_handler_called, up_log.call + log.call) - if defined?(OpenSSL) + if defined?(OpenSSL::TestUtils) # Testing CONNECT to the upstream proxy server # # client -------> proxy -------> proxy -------> https