summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-22 16:58:33 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-22 16:58:33 +0000
commit656a600659bc5075278df532d3776bc5958daaa9 (patch)
tree8605c9fca177941cbbdcfc1b5d6444047844d58e
parent02186fb076ba6eab250a51bb76effda47c029ed9 (diff)
downloadruby-656a600659bc5075278df532d3776bc5958daaa9.tar.gz
ruby-656a600659bc5075278df532d3776bc5958daaa9.tar.xz
ruby-656a600659bc5075278df532d3776bc5958daaa9.zip
* lib/net/imap.rb (initialize): handle certs correctly. Thanks,
NABEYA Kenichi. (backported from CVS HEAD) git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/net/imap.rb11
2 files changed, 11 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 590fc0897..437cf664c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 640f2bd56..29b6359e0 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