summaryrefslogtreecommitdiff
path: root/lib/bundler/vendored_persistent.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/vendored_persistent.rb')
-rw-r--r--lib/bundler/vendored_persistent.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/bundler/vendored_persistent.rb b/lib/bundler/vendored_persistent.rb
index 7670b83992..045a761dac 100644
--- a/lib/bundler/vendored_persistent.rb
+++ b/lib/bundler/vendored_persistent.rb
@@ -20,13 +20,15 @@ require_relative "vendor/net-http-persistent/lib/net/http/persistent"
module Bundler
class PersistentHTTP < Persistent::Net::HTTP::Persistent
def connection_for(uri)
- connection = super
- warn_old_tls_version_rubygems_connection(uri, connection)
- connection
+ super(uri) do |connection|
+ result = yield connection
+ warn_old_tls_version_rubygems_connection(uri, connection)
+ result
+ end
end
def warn_old_tls_version_rubygems_connection(uri, connection)
- return unless connection.use_ssl?
+ return unless connection.http.use_ssl?
return unless (uri.host || "").end_with?("rubygems.org")
socket = connection.instance_variable_get(:@socket)