summaryrefslogtreecommitdiff
path: root/test/net
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-27 06:57:39 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-27 06:57:39 +0000
commit93fba33b47524f24b018c09b79a01712a5605093 (patch)
treead23a4f834fc761ab5edf3670800090bf58e61d4 /test/net
parent39ac0609d57fbbd89ddd8f23383edcc64a8a5378 (diff)
* test/net/http/test_https.rb: As always, localhost is not
guaranteed to be resolved as 127.0.0.1. But a SSL certificate needs a socket to listen on a specific address where a CN resolves to. On situations where localhost is not 127.0.0.1, these tests are not possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net')
-rw-r--r--test/net/http/test_https.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/net/http/test_https.rb b/test/net/http/test_https.rb
index f66f99ed41..95c63da750 100644
--- a/test/net/http/test_https.rb
+++ b/test/net/http/test_https.rb
@@ -40,6 +40,8 @@ class TestNetHTTPS < Test::Unit::TestCase
http.request_get("/") {|res|
assert_equal($test_net_http_data, res.body)
}
+ rescue SystemCallError
+ skip $!
end
def test_post
@@ -52,6 +54,8 @@ class TestNetHTTPS < Test::Unit::TestCase
http.request_post("/", data) {|res|
assert_equal(data, res.body)
}
+ rescue SystemCallError
+ skip $!
end
if ENV["RUBY_OPENSSL_TEST_ALL"]
@@ -72,13 +76,19 @@ class TestNetHTTPS < Test::Unit::TestCase
http.request_get("/") {|res|
assert_equal($test_net_http_data, res.body)
}
+ rescue SystemCallError
+ skip $!
end
def test_certificate_verify_failure
http = Net::HTTP.new("localhost", config("port"))
http.use_ssl = true
ex = assert_raise(OpenSSL::SSL::SSLError){
- http.request_get("/") {|res| }
+ begin
+ http.request_get("/") {|res| }
+ rescue SystemCallError
+ skip $!
+ end
}
assert_match(/certificate verify failed/, ex.message)
end