mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/net/imap.rb (initialize): accept service name. changed
the defalut value of the old style +verify+ argument to true. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1ee46d76c4
commit
ad89f7e6d2
2 changed files with 12 additions and 9 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Dec 21 15:24:22 2007 Shugo Maeda <shugo@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/net/imap.rb (initialize): accept service name. changed
|
||||||
|
the defalut value of the old style +verify+ argument to true.
|
||||||
|
|
||||||
Fri Dec 21 15:15:44 2007 Tanaka Akira <akr@fsij.org>
|
Fri Dec 21 15:15:44 2007 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* gc.c (rb_garbage_collect): new function for debugging.
|
* gc.c (rb_garbage_collect): new function for debugging.
|
||||||
|
|
|
@ -330,7 +330,7 @@ module Net
|
||||||
end
|
end
|
||||||
|
|
||||||
# Sends a STARTTLS command to start TLS session.
|
# Sends a STARTTLS command to start TLS session.
|
||||||
def starttls(options = {}, verify = false)
|
def starttls(options = {}, verify = true)
|
||||||
send_command("STARTTLS") do |resp|
|
send_command("STARTTLS") do |resp|
|
||||||
if resp.kind_of?(TaggedResponse) && resp.name == "OK"
|
if resp.kind_of?(TaggedResponse) && resp.name == "OK"
|
||||||
begin
|
begin
|
||||||
|
@ -909,20 +909,18 @@ module Net
|
||||||
# Net::IMAP::ByeResponseError:: we connected to the host, but they
|
# Net::IMAP::ByeResponseError:: we connected to the host, but they
|
||||||
# immediately said goodbye to us.
|
# immediately said goodbye to us.
|
||||||
def initialize(host, port_or_options = {},
|
def initialize(host, port_or_options = {},
|
||||||
usessl = false, certs = nil, verify = false)
|
usessl = false, certs = nil, verify = true)
|
||||||
super()
|
super()
|
||||||
@host = host
|
@host = host
|
||||||
begin
|
begin
|
||||||
|
options = port_or_options.to_hash
|
||||||
|
rescue NoMethodError
|
||||||
# for backward compatibility
|
# for backward compatibility
|
||||||
port = port_or_options.to_int
|
options = {}
|
||||||
options = {
|
options[:port] = port_or_options
|
||||||
:port => port
|
|
||||||
}
|
|
||||||
if usessl
|
if usessl
|
||||||
options[:ssl] = create_ssl_params(certs, verify)
|
options[:ssl] = create_ssl_params(certs, verify)
|
||||||
end
|
end
|
||||||
rescue NoMethodError
|
|
||||||
options = port_or_options
|
|
||||||
end
|
end
|
||||||
@port = options[:port] || (options[:ssl] ? SSL_PORT : PORT)
|
@port = options[:port] || (options[:ssl] ? SSL_PORT : PORT)
|
||||||
@tag_prefix = "RUBY"
|
@tag_prefix = "RUBY"
|
||||||
|
@ -1240,7 +1238,7 @@ module Net
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_ssl_params(certs = nil, verify = false)
|
def create_ssl_params(certs = nil, verify = true)
|
||||||
params = {}
|
params = {}
|
||||||
if certs
|
if certs
|
||||||
if File.file?(certs)
|
if File.file?(certs)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue