diff --git a/ChangeLog b/ChangeLog index 5fd9cb8755..6a4ec82c62 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Wed Dec 10 02:48:46 2014 NAKAMURA Usaku + + * test/net/http/test_https.rb + (TestNetHTTPS#test_certificate_verify_failure): on Windows, + Errno::ECONNRESET will be raised when the verify is failure at the + client side, and it'll be eaten by WEBrick. + + * test/open-uri/test_ssl.rb (TestOpenURISSL#test_validation_failure): + ditto. + Wed Dec 10 00:42:13 2014 Eric Wong * iseq.c (rb_method_for_self_aref, rb_method_for_self_aset): diff --git a/test/net/http/test_https.rb b/test/net/http/test_https.rb index 486375a55c..987ea7c3f2 100644 --- a/test/net/http/test_https.rb +++ b/test/net/http/test_https.rb @@ -149,10 +149,14 @@ class TestNetHTTPS < Test::Unit::TestCase end } assert_match(/certificate verify failed/, ex.message) - @log_tester = lambda {|log| - assert_equal(1, log.length) - assert_match(/ERROR OpenSSL::SSL::SSLError:/, log[0]) - } + unless /mswin|mingw/ =~ RUBY_PLATFORM + # on Windows, Errno::ECONNRESET will be raised, and it'll be eaten by + # WEBrick + @log_tester = lambda {|log| + assert_equal(1, log.length) + assert_match(/ERROR OpenSSL::SSL::SSLError:/, log[0]) + } + end end def test_identity_verify_failure diff --git a/test/open-uri/test_ssl.rb b/test/open-uri/test_ssl.rb index d1ea57174a..d56ca86fa1 100644 --- a/test/open-uri/test_ssl.rb +++ b/test/open-uri/test_ssl.rb @@ -91,10 +91,14 @@ class TestOpenURISSL end def test_validation_failure - log_tester = lambda {|server_log| - assert_equal(1, server_log.length) - assert_match(/ERROR OpenSSL::SSL::SSLError:/, server_log[0]) - } + unless /mswin|mingw/ =~ RUBY_PLATFORM + # on Windows, Errno::ECONNRESET will be raised, and it'll be eaten by + # WEBrick + log_tester = lambda {|server_log| + assert_equal(1, server_log.length) + assert_match(/ERROR OpenSSL::SSL::SSLError:/, server_log[0]) + } + end with_https(log_tester) {|srv, dr, url, server_thread, server_log| setup_validation(srv, dr) assert_raise(OpenSSL::SSL::SSLError) { open("#{url}/data") {} }