diff --git a/ChangeLog b/ChangeLog index 29bd86f8fd..b721da7b21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Feb 23 01:53:29 2005 Shugo Maeda + + * lib/net/imap.rb (initialize): handle certs correctly. Thanks, + NABEYA Kenichi. + Wed Feb 23 00:37:34 2005 Kouhei Sutou * lib/mkmf.rb (mkmf_failed): fixed typo. diff --git a/lib/net/imap.rb b/lib/net/imap.rb index e12b4bac3a..82d5b29738 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -885,15 +885,16 @@ module Net raise "SSL extension not installed" end @usessl = true - @sock = SSLSocket.new(@sock) # verify the server. - @sock.ca_file = certs if certs && FileTest::file?(certs) - @sock.ca_path = certs if certs && FileTest::directory?(certs) - @sock.verify_mode = VERIFY_PEER if verify + context = SSLContext::new() + context.ca_file = certs if certs && FileTest::file?(certs) + context.ca_path = certs if certs && FileTest::directory?(certs) + context.verify_mode = VERIFY_PEER if verify if defined?(VerifyCallbackProc) - @sock.verify_callback = VerifyCallbackProc + context.verify_callback = VerifyCallbackProc end + @sock = SSLSocket.new(@sock, context) @sock.connect # start ssl session. else @usessl = false