* lib/net/imap.rb (initialize): handle certs correctly. Thanks,

NABEYA Kenichi.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shugo 2005-02-22 16:55:31 +00:00
Родитель 6b68105ab2
Коммит ec2e637cb4
2 изменённых файлов: 11 добавлений и 5 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Wed Feb 23 01:53:29 2005 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/imap.rb (initialize): handle certs correctly. Thanks,
NABEYA Kenichi.
Wed Feb 23 00:37:34 2005 Kouhei Sutou <kou@cozmixng.org>
* lib/mkmf.rb (mkmf_failed): fixed typo.

Просмотреть файл

@ -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