Project

General

Profile

Actions

Bug #4187

closed

Error: test_starttls(IMAPTest)

Added by znz (Kazuhiro NISHIYAMA) about 13 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3dev (2010-12-22 trunk 30291) [x86_64-linux]
Backport:
[ruby-dev:42860]

Description

=begin
test_starttls で Error になります。
IOError の方が多いのですが、何度か実行していると OpenSSL::SSL::SSLError になることもあるようです。
表面化するようになった理由は #4186 と同じ証明書の期限切れのようです。

assert がないのでエラーになった方が良いのかもしれませんが、 imap.logout と imap.disconnect の
ところに imap.disconnected? のチェックを追加するとエラーにならなくなるようです。

  1. Error:
    test_starttls(IMAPTest):
    IOError: closed stream
    test/net/imap/test_imap.rb:440:in ensure in starttls_test' test/net/imap/test_imap.rb:440:in starttls_test'
    test/net/imap/test_imap.rb:109:in `test_starttls'

  2. Error:
    test_starttls(IMAPTest):
    OpenSSL::SSL::SSLError: SSL_write:: certificate verify failed
    test/net/imap/test_imap.rb:438:in starttls_test' test/net/imap/test_imap.rb:109:in test_starttls'

diff --git a/test/net/imap/test_imap.rb b/test/net/imap/test_imap.rb
index 8ccec64..01982ab 100644
--- a/test/net/imap/test_imap.rb
+++ b/test/net/imap/test_imap.rb
@@ -435,9 +435,9 @@ class IMAPTest < Test::Unit::TestCase
begin
begin
imap = yield(port)

  •    imap.logout
    
  •    imap.logout if !imap.disconnected?
     ensure
    
  •    imap.disconnect if imap
    
  •    imap.disconnect if imap && !imap.disconnected?
     end
    
    ensure
    server.close
    =end

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #4186: Failure: test_imaps_with_ca_file(IMAPTest)Closed12/23/2010Actions
Actions #1

Updated by shugo (Shugo Maeda) about 13 years ago

=begin
前田です。

2010年12月23日7:47 Kazuhiro NISHIYAMA :

test_starttls で Error になります。
IOError の方が多いのですが、何度か実行していると OpenSSL::SSL::SSLError になることもあるようです。
表面化するようになった理由は #4186 と同じ証明書の期限切れのようです。

assert がないのでエラーになった方が良いのかもしれませんが、 imap.logout と imap.disconnect の
ところに imap.disconnected? のチェックを追加するとエラーにならなくなるようです。

いただいたパッチで問題なさそうなので、後でcommitしておきます。

--
Shugo Maeda

=end

Actions #2

Updated by shugo (Shugo Maeda) about 13 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r30544.
Kazuhiro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • test/net/imap/test_imap.rb: call neither logout nor disconnect
    unless connected. patch by Kazuhiro NISHIYAMA. [ruby-dev:42860]
    =end
Actions

Also available in: Atom PDF

Like0
Like0Like0