diff options
Diffstat (limited to 'lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb')
-rw-r--r-- | lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb index 847479a0af..d0ab956faf 100644 --- a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +++ b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb @@ -3,6 +3,8 @@ require_relative '../../../../uri/lib/uri' require 'cgi' # for escaping require_relative '../../../../connection_pool/lib/connection_pool' +autoload :OpenSSL, 'openssl' + ## # Persistent connections for Net::HTTP # @@ -147,14 +149,9 @@ class Bundler::Persistent::Net::HTTP::Persistent EPOCH = Time.at 0 # :nodoc: ## - # Is OpenSSL available? + # Is OpenSSL available? This test works with autoload - HAVE_OPENSSL = begin # :nodoc: - require 'openssl' - true - rescue LoadError - false - end + HAVE_OPENSSL = defined? OpenSSL::SSL # :nodoc: ## # The default connection pool size is 1/4 the allowed open files |