Permalink
Browse files

Check verify_depth with 1 and 2

0 seems not work on Travis worker. Drop meaningless test.
  • Loading branch information...
nahi committed Oct 12, 2011
1 parent 30bb264 commit 3f84cd95efeabe2a55a8188d56c108bfe36e0f57
Showing with 7 additions and 4 deletions.
  1. +7 −4 test/test_ssl.rb
View
@@ -99,18 +99,21 @@ def test_verification
assert_equal("hello", @client.get_content(@url))
assert(@verify_callback_called)
#
- cfg.verify_depth = 0
+ cfg.verify_depth = 1 # 2 required: root-sub
@verify_callback_called = false
begin
@client.get(@url)
- puts OpenSSL::OPENSSL_VERSION
- puts @verify_callback_called
- #assert(false, "verify_depth is not supported? #{OpenSSL::OPENSSL_VERSION}")
+ assert(false, "verify_depth is not supported? #{OpenSSL::OPENSSL_VERSION}")
rescue OpenSSL::SSL::SSLError => ssle
assert_match(/certificate verify failed/, ssle.message)
assert(@verify_callback_called)
end
#
+ cfg.verify_depth = 2 # 2 required: root-sub
+ @verify_callback_called = false
+ @client.get(@url)
+ assert(@verify_callback_called)
+ #
cfg.verify_depth = nil
cfg.cert_store = OpenSSL::X509::Store.new
cfg.verify_mode = OpenSSL::SSL::VERIFY_PEER

0 comments on commit 3f84cd9

Please sign in to comment.