summaryrefslogtreecommitdiffstats
path: root/test/test_pair.rb
diff options
context:
space:
mode:
authornahi <nahi@ruby-lang.org>2011-07-14 05:41:05 +0000
committernahi <nahi@ruby-lang.org>2011-07-14 05:41:05 +0000
commitd264ff472aa5f8e91ae0463d6560df21cc64a6af (patch)
tree66d51159c03c92bb2d10833d727c5537140eab94 /test/test_pair.rb
parentac00769bcb08136eac77053b37437f47ec01fa26 (diff)
downloadruby-openssl-history-d264ff472aa5f8e91ae0463d6560df21cc64a6af.tar.gz
* ext/openssl/ossl.c (ossl_verify_cb): trap the exception from
verify callback of SSLContext and X509Store and make the verification fail normally. Raising exception directly from callback causes orphan resouces in OpenSSL stack. Patched by Ippei Obayashi. See #4445. * test/openssl/test_ssl.rb (test_exception_in_verify_callback_is_ignored): test it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_pair.rb')
-rw-r--r--test/test_pair.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/test_pair.rb b/test/test_pair.rb
index d31781f..940fa0c 100644
--- a/test/test_pair.rb
+++ b/test/test_pair.rb
@@ -238,6 +238,8 @@ class OpenSSL::TestPair < Test::Unit::TestCase
s1.print "a\ndef"
assert_equal("a\n", s2.gets)
ensure
+ s1.close if s1 && !s1.closed?
+ s2.close if s2 && !s2.closed?
serv.close if serv && !serv.closed?
sock1.close if sock1 && !sock1.closed?
sock2.close if sock2 && !sock2.closed?