diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/net/imap.rb | 11 |
2 files changed, 11 insertions, 5 deletions
@@ -1,3 +1,8 @@ +Wed Feb 23 01:57:46 2005 Shugo Maeda <shugo@ruby-lang.org> + + * lib/net/imap.rb (initialize): handle certs correctly. Thanks, + NABEYA Kenichi. (backported from CVS HEAD) + Tue Feb 22 07:25:18 2005 Nobuyoshi Nakada <nobu@ruby-lang.org> * parse.y (parser_yylex): identfier after dot must not be a variable. diff --git a/lib/net/imap.rb b/lib/net/imap.rb index 640f2bd566..29b6359e0e 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 |