Skip to content

Commit

Permalink
Add HTTPS Proxy support (#47)
Browse files Browse the repository at this point in the history
* Add HTTPS Proxy support

net-http version 0.5.0 finally introduced TLS proxy support: ruby/net-http#55
https://github.com/ruby/net-http/releases/tag/v0.5.0

* Add mininum net-http version

SSL proxies only supported in net-http 0.5.0 or above
  • Loading branch information
richardmarbach authored Nov 11, 2024
1 parent 046f0cc commit 724af4d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion faraday-net_http.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ Gem::Specification.new do |spec|
spec.files = Dir.glob('lib/**/*') + %w[README.md LICENSE.md]
spec.require_paths = ['lib']

spec.add_runtime_dependency 'net-http'
spec.add_runtime_dependency 'net-http', '>= 0.5.0'
end
3 changes: 2 additions & 1 deletion lib/faraday/adapter/net_http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def net_http_connection(env)
if proxy
Net::HTTP.new(env[:url].hostname, port,
proxy[:uri].hostname, proxy[:uri].port,
proxy[:user], proxy[:password])
proxy[:user], proxy[:password],
proxy[:uri].scheme == 'https')
else
Net::HTTP.new(env[:url].hostname, port, nil)
end
Expand Down

0 comments on commit 724af4d

Please sign in to comment.