diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-13 08:03:22 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-13 08:03:22 +0000 |
commit | df366010177157228cb11d2cd6050bc32044df8f (patch) | |
tree | fac284942cc6d6652c03536ac37a9b9f431acfe1 /lib/net/http.rb | |
parent | 1afe9dbdfd18052c4882b7ba3312945aaf3ae64c (diff) | |
download | ruby-df366010177157228cb11d2cd6050bc32044df8f.tar.gz |
* lib/net/http.rb (Net::HTTP#use_ssl?): require 'openssl' only when
https is needed. fixes r31933.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/http.rb')
-rw-r--r-- | lib/net/http.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb index d3be00036b..2ff6e5524c 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -657,8 +657,10 @@ module Net #:nodoc: # Returns true if SSL/TLS is being used with HTTP. def use_ssl? - require 'openssl' unless defined?(OpenSSL) - @use_ssl + if @use_ssl + require 'openssl' unless defined?(OpenSSL) + true + end end # Turn on/off SSL. |