Bug #9341


IMAPTest#test_imaps_with_ca_file test failed after 2014-01-01.

Added by phasis68 (Heesob Park) almost 9 years ago. Updated almost 9 years ago.

Target version:
ruby -v:
ruby 2.2.0dev (2014-01-02 trunk 44483) [x64-mswin64_100]


The test IMAPTest#test_imaps_with_ca_file failed with the following error after 2014-01-01 on all platforms in

IMAPTest#test_imaps_with_ca_file [D:/tmp/mswin-build20140102-4508-1arnv64/ruby/test/net/imap/test_imap.rb:74]:
Exception raised:
<#<OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed>>.

OpenSSL::SSL::SSLError: SSL_write: certificate verify failed
D:/tmp/mswin-build20140102-4508-1arnv64/ruby/.ext/common/openssl/buffering.rb:326:in syswrite' D:/tmp/mswin-build20140102-4508-1arnv64/ruby/.ext/common/openssl/buffering.rb:326:in do_write'
D:/tmp/mswin-build20140102-4508-1arnv64/ruby/.ext/common/openssl/buffering.rb:423:in print' D:/tmp/mswin-build20140102-4508-1arnv64/ruby/lib/net/imap.rb:1225:in put_string'
D:/tmp/mswin-build20140102-4508-1arnv64/ruby/lib/net/imap.rb:1197:in block in send_command' D:/tmp/mswin-build20140102-4508-1arnv64/ruby/lib/monitor.rb:211:in mon_synchronize'
D:/tmp/mswin-build20140102-4508-1arnv64/ruby/lib/net/imap.rb:1192:in send_command' D:/tmp/mswin-build20140102-4508-1arnv64/ruby/lib/net/imap.rb:368:in logout'
D:/tmp/mswin-build20140102-4508-1arnv64/ruby/test/net/imap/test_imap.rb:524:in starttls_test' D:/tmp/mswin-build20140102-4508-1arnv64/ruby/test/net/imap/test_imap.rb:113:in test_starttls'

I found the cause of this failure is due to the expired certificate validity period.

The current validity period is defined as
Not Before: Dec 23 10:23:52 2010 GMT
Not After : Jan 1 10:23:52 2014 GMT

Found in test/net/imap/server.crt and test/net/imap/cacert.pem

Updated by nobu (Nobuyoshi Nakada) almost 9 years ago

Yes, I know it, but not how to refresh it.

Updated by phasis68 (Heesob Park) almost 9 years ago

You must recreate the certificates.

Refer to

Updated by nobu (Nobuyoshi Nakada) almost 9 years ago

  • Category set to test
  • Status changed from Open to Assigned
  • Assignee set to shugo (Shugo Maeda)
  • Target version set to 2.2.0
  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN to 1.9.3: REQUIRED, 2.0.0: REQUIRED, 2.1: REQUIRED
Actions #4

Updated by tmm1 (Aman Karmani) almost 9 years ago

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

This issue was solved with changeset r44488.
Heesob, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

test/net/imap/test_imap.rb: fix test failures due to expired certs

  • test/net/imap/cacert.pem: generate new CA cert, since the last one
    expired. [Bug #9341] [ruby-core:59459]
  • test/net/imap/server.crt: new server cert signed with updated CA.
  • test/net/imap/Makefile: add make regen_certs to automate this

Updated by nagachika (Tomoyuki Chikanaga) almost 9 years ago

  • Backport changed from 1.9.3: REQUIRED, 2.0.0: REQUIRED, 2.1: REQUIRED to 1.9.3: REQUIRED, 2.0.0: DONE, 2.1: REQUIRED

r44488 and r44489 were backported to ruby_2_0_0 branch at r44491.

Updated by usa (Usaku NAKAMURA) almost 9 years ago

  • Backport changed from 1.9.3: REQUIRED, 2.0.0: DONE, 2.1: REQUIRED to 1.9.3: DONE, 2.0.0: DONE, 2.1: DONE

backported into ruby_1_9_3 at r44533.
and, seems to be backported into ruby_2_1 at r44528.


Also available in: Atom PDF