Additional fix for r31933.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5112c6d1d9
commit
2ba3909c0a
@ -544,7 +544,6 @@ module Net #:nodoc:
|
|||||||
|
|
||||||
if opt
|
if opt
|
||||||
if opt[:use_ssl]
|
if opt[:use_ssl]
|
||||||
require 'openssl' unless defined?(OpenSSL)
|
|
||||||
opt = {verify_mode: OpenSSL::SSL::VERIFY_PEER}.update(opt)
|
opt = {verify_mode: OpenSSL::SSL::VERIFY_PEER}.update(opt)
|
||||||
end
|
end
|
||||||
http.methods.grep(/\A(\w+)=\z/) do |meth|
|
http.methods.grep(/\A(\w+)=\z/) do |meth|
|
||||||
@ -657,10 +656,7 @@ module Net #:nodoc:
|
|||||||
|
|
||||||
# Returns true if SSL/TLS is being used with HTTP.
|
# Returns true if SSL/TLS is being used with HTTP.
|
||||||
def use_ssl?
|
def use_ssl?
|
||||||
if @use_ssl
|
@use_ssl
|
||||||
require 'openssl' unless defined?(OpenSSL)
|
|
||||||
true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Turn on/off SSL.
|
# Turn on/off SSL.
|
||||||
@ -668,7 +664,12 @@ module Net #:nodoc:
|
|||||||
# If you change use_ssl value after session started,
|
# If you change use_ssl value after session started,
|
||||||
# a Net::HTTP object raises IOError.
|
# a Net::HTTP object raises IOError.
|
||||||
def use_ssl=(flag)
|
def use_ssl=(flag)
|
||||||
flag = (flag ? true : false)
|
flag = if flag
|
||||||
|
require 'openssl' unless defined?(OpenSSL)
|
||||||
|
true
|
||||||
|
else
|
||||||
|
false
|
||||||
|
end
|
||||||
if started? and @use_ssl != flag
|
if started? and @use_ssl != flag
|
||||||
raise IOError, "use_ssl value changed, but session already started"
|
raise IOError, "use_ssl value changed, but session already started"
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user