From 17abe065664cb58725f2673016f78064876cc2f4 Mon Sep 17 00:00:00 2001 From: gaura Date: Wed, 4 Apr 2018 13:46:35 +0900 Subject: [PATCH] Allow proxy with authentication --- lib/jira/http_client.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/jira/http_client.rb b/lib/jira/http_client.rb index 73d5f017..71d54541 100644 --- a/lib/jira/http_client.rb +++ b/lib/jira/http_client.rb @@ -43,12 +43,12 @@ def basic_auth_http_conn end def http_conn(uri) + http_conn = nil if @options[:proxy_address] - http_class = Net::HTTP::Proxy(@options[:proxy_address], @options[:proxy_port] ? @options[:proxy_port] : 80) + http_conn = Net::HTTP::new(uri.host, uri.port, @options[:proxy_address], @options.fetch(:proxy_port, 80), @options[:proxy_user], @options[:proxy_pass]) else - http_class = Net::HTTP + http_conn = Net::HTTP::new(uri.host, uri.port) end - http_conn = http_class.new(uri.host, uri.port) http_conn.use_ssl = @options[:use_ssl] if @options[:use_client_cert] http_conn.cert = @options[:cert]