summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--test/net/http/test_https.rb12
2 files changed, 19 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 34ec875b1f..93d2e40cfd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Mon Sep 27 15:54:03 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * 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.
+
Mon Sep 27 15:25:05 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
* test/net/imap/test_imap.rb: resurrection of r29259.
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