diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb index a292c4f420d..c367631d909 100644 --- a/lib/bundler/fetcher.rb +++ b/lib/bundler/fetcher.rb @@ -59,8 +59,8 @@ def initialize(remote_uri) @remote_uri = remote_uri @public_uri = remote_uri.dup @public_uri.user, @public_uri.password = nil, nil # don't print these - if USE_PERSISTENT - @connection ||= Net::HTTP::Persistent.new 'bundler', :ENV + if defined?(OpenSSL::SSL) + @connection = Net::HTTP::Persistent.new 'bundler', :ENV else if @remote_uri.scheme == "https" raise Bundler::HTTPError, "Could not load OpenSSL.\n" \ @@ -191,7 +191,7 @@ def fetch(uri, counter = 0) begin Bundler.ui.debug "Fetching from: #{uri}" - if USE_PERSISTENT + if @connection.is_a?(Net::HTTP::Persistent) response = @connection.request(uri) else req = Net::HTTP::Get.new uri.request_uri diff --git a/lib/bundler/vendored_persistent.rb b/lib/bundler/vendored_persistent.rb index 54204cfd5e7..57266636427 100644 --- a/lib/bundler/vendored_persistent.rb +++ b/lib/bundler/vendored_persistent.rb @@ -5,11 +5,6 @@ vendor = File.expand_path('../vendor', __FILE__) $:.unshift(vendor) unless $:.include?(vendor) require 'net/http/persistent' - - USE_PERSISTENT = true - rescue LoadError, NameError => e require 'net/http' - USE_PERSISTENT = false - end