From df366010177157228cb11d2cd6050bc32044df8f Mon Sep 17 00:00:00 2001 From: naruse Date: Mon, 13 Jun 2011 08:03:22 +0000 Subject: [PATCH] * 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 --- ChangeLog | 5 +++++ lib/net/http.rb | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7876775488..ccf154bf0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Jun 13 17:02:34 2011 NARUSE, Yui + + * lib/net/http.rb (Net::HTTP#use_ssl?): require 'openssl' only when + https is needed. fixes r31933. + Mon Jun 13 14:35:00 2011 Kenta Murata * lib/cmath.rb (CMath.cbrt): returns the principal value of the cube 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.