summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-29 15:48:47 +0000
committerrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-29 15:48:47 +0000
commitdb31f2fafb3634364bba91130162bc9c394f8232 ()
tree01456372d82b796335c87156eb180ecc7c22c926
parent0cc0080a49bc59cbe7dee7f53c337935fe169995 (diff)
webrick: don't use OpenSSL::TestUtils from webrick tests
Follow net/http and open-uri. Don't rely on the constants/methods from OpenSSL::TestUtils. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/webrick/test_httpproxy.rb58
1 files changed, 48 insertions, 10 deletions
@@ -6,7 +6,6 @@ require "webrick/httpproxy"
begin
require "webrick/ssl"
require "net/https"
- require File.expand_path("../openssl/utils.rb", File.dirname(__FILE__))
rescue LoadError
# test_connect will be skipped
end
@@ -124,12 +123,19 @@ class TestWEBrickHTTPProxy < Test::Unit::TestCase
exts = [
["keyUsage", "keyEncipherment,digitalSignature", true],
]
- cert = OpenSSL::TestUtils.issue_cert(
- subject, key, 1, Time.now, Time.now + 3600, exts,
- nil, nil, OpenSSL::Digest::SHA1.new
- )
return cert
- end if defined?(OpenSSL::TestUtils)
def test_connect
# Testing CONNECT to proxy server
@@ -139,7 +145,7 @@ class TestWEBrickHTTPProxy < Test::Unit::TestCase
# 2. ---- establish SSL session --->
# 3. ------- GET or POST ---------->
#
- key = OpenSSL::TestUtils::TEST_KEY_RSA1024
cert = make_certificate(key, "127.0.0.1")
s_config = {
:SSLEnable =>true,
@@ -178,7 +184,7 @@ class TestWEBrickHTTPProxy < Test::Unit::TestCase
}
}
}
- end if defined?(OpenSSL::TestUtils)
def test_upstream_proxy
# Testing GET or POST through the upstream proxy server
@@ -246,7 +252,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::TestUtils)
# Testing CONNECT to the upstream proxy server
#
# client -------> proxy -------> proxy -------> https
@@ -254,7 +260,7 @@ class TestWEBrickHTTPProxy < Test::Unit::TestCase
# 2. -------- establish SSL session ------>
# 3. ---------- GET or POST -------------->
#
- key = OpenSSL::TestUtils::TEST_KEY_RSA1024
cert = make_certificate(key, "127.0.0.1")
s_config = {
:SSLEnable =>true,
@@ -287,4 +293,36 @@ class TestWEBrickHTTPProxy < Test::Unit::TestCase
}
}
end
end