summaryrefslogtreecommitdiff
path: root/lib/bundler/fetcher.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/fetcher.rb')
-rw-r--r--lib/bundler/fetcher.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb
index f5ad0347e7..951cc95200 100644
--- a/lib/bundler/fetcher.rb
+++ b/lib/bundler/fetcher.rb
@@ -203,7 +203,12 @@ module Bundler
else
req = Net::HTTP::Get.new uri.request_uri
req.basic_auth(uri.user, uri.password) if uri.user && uri.password
- response = @connection.request(req)
+ if uri.host == @connection.address && uri.port == @connection.port
+ connection = @connection
+ else
+ connection = Net::HTTP.new(uri.host, uri.port)
+ end
+ response = connection.request(req)
end
rescue OpenSSL::SSL::SSLError
raise CertificateFailureError.new(@public_uri)