(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.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2014-12-09 17:51:43 +00:00
Родитель 9d237f434e
Коммит bf4b7f3b8c
3 изменённых файлов: 26 добавлений и 8 удалений

Просмотреть файл

@ -1,3 +1,13 @@
Wed Dec 10 02:48:46 2014 NAKAMURA Usaku <usa@ruby-lang.org>
* 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@80x24.org> Wed Dec 10 00:42:13 2014 Eric Wong <e@80x24.org>
* iseq.c (rb_method_for_self_aref, rb_method_for_self_aset): * iseq.c (rb_method_for_self_aref, rb_method_for_self_aset):

Просмотреть файл

@ -149,10 +149,14 @@ class TestNetHTTPS < Test::Unit::TestCase
end end
} }
assert_match(/certificate verify failed/, ex.message) assert_match(/certificate verify failed/, ex.message)
@log_tester = lambda {|log| unless /mswin|mingw/ =~ RUBY_PLATFORM
assert_equal(1, log.length) # on Windows, Errno::ECONNRESET will be raised, and it'll be eaten by
assert_match(/ERROR OpenSSL::SSL::SSLError:/, log[0]) # WEBrick
} @log_tester = lambda {|log|
assert_equal(1, log.length)
assert_match(/ERROR OpenSSL::SSL::SSLError:/, log[0])
}
end
end end
def test_identity_verify_failure def test_identity_verify_failure

Просмотреть файл

@ -91,10 +91,14 @@ class TestOpenURISSL
end end
def test_validation_failure def test_validation_failure
log_tester = lambda {|server_log| unless /mswin|mingw/ =~ RUBY_PLATFORM
assert_equal(1, server_log.length) # on Windows, Errno::ECONNRESET will be raised, and it'll be eaten by
assert_match(/ERROR OpenSSL::SSL::SSLError:/, server_log[0]) # 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| with_https(log_tester) {|srv, dr, url, server_thread, server_log|
setup_validation(srv, dr) setup_validation(srv, dr)
assert_raise(OpenSSL::SSL::SSLError) { open("#{url}/data") {} } assert_raise(OpenSSL::SSL::SSLError) { open("#{url}/data") {} }