lib/braintree/http.rb in braintree-2.64.0 vs lib/braintree/http.rb in braintree-2.65.0
- old
+ new
@@ -57,10 +57,22 @@
end.join("&")
end
end
def _http_do(http_verb, path, body = nil)
- connection = Net::HTTP.new(@config.server, @config.port)
+ if @config.proxy_address
+ connection = Net::HTTP.new(
+ @config.server,
+ @config.port,
+ @config.proxy_address,
+ @config.proxy_port,
+ @config.proxy_user,
+ @config.proxy_pass
+ )
+ else
+ connection = Net::HTTP.new(@config.server, @config.port)
+ end
+
connection.open_timeout = @config.http_open_timeout
connection.read_timeout = @config.http_read_timeout
if @config.ssl?
connection.use_ssl = true
connection.verify_mode = OpenSSL::SSL::VERIFY_PEER