ruby-changes:36670
From: usa <ko1@a...>
Date: Wed, 10 Dec 2014 02:51:57 +0900 (JST)
Subject: [ruby-changes:36670] usa:r48751 (trunk): * test/net/http/test_https.rb
usa 2014-12-10 02:51:43 +0900 (Wed, 10 Dec 2014) New Revision: 48751 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48751 Log: * 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. Modified files: trunk/ChangeLog trunk/test/net/http/test_https.rb trunk/test/open-uri/test_ssl.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 48750) +++ ChangeLog (revision 48751) @@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Dec 10 02:48:46 2014 NAKAMURA Usaku <usa@r...> + + * 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 <e@8...> * iseq.c (rb_method_for_self_aref, rb_method_for_self_aset): Index: test/open-uri/test_ssl.rb =================================================================== --- test/open-uri/test_ssl.rb (revision 48750) +++ test/open-uri/test_ssl.rb (revision 48751) @@ -91,10 +91,14 @@ class TestOpenURISSL https://github.com/ruby/ruby/blob/trunk/test/open-uri/test_ssl.rb#L91 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") {} } Index: test/net/http/test_https.rb =================================================================== --- test/net/http/test_https.rb (revision 48750) +++ test/net/http/test_https.rb (revision 48751) @@ -149,10 +149,14 @@ class TestNetHTTPS < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/net/http/test_https.rb#L149 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/