mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
1 changed files with 7 additions and 6 deletions
|
@ -544,7 +544,6 @@ module Net #:nodoc:
|
|||
|
||||
if opt
|
||||
if opt[:use_ssl]
|
||||
require 'openssl' unless defined?(OpenSSL)
|
||||
opt = {verify_mode: OpenSSL::SSL::VERIFY_PEER}.update(opt)
|
||||
end
|
||||
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.
|
||||
def use_ssl?
|
||||
if @use_ssl
|
||||
require 'openssl' unless defined?(OpenSSL)
|
||||
true
|
||||
end
|
||||
@use_ssl
|
||||
end
|
||||
|
||||
# Turn on/off SSL.
|
||||
|
@ -668,7 +664,12 @@ module Net #:nodoc:
|
|||
# If you change use_ssl value after session started,
|
||||
# a Net::HTTP object raises IOError.
|
||||
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
|
||||
raise IOError, "use_ssl value changed, but session already started"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue