Skip to content

Commit

Permalink
feat: use certificates from SSL_CERT_FILE and SSL_CERT_DIR environmen…
Browse files Browse the repository at this point in the history
…t variables in HTTP connections
  • Loading branch information
mcclenney authored Feb 13, 2020
1 parent f24257b commit 164912b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/pact/hal/http_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def perform_request request, uri
http = Net::HTTP.new(uri.host, uri.port, :ENV)
http.set_debug_output(output_stream) if verbose
http.use_ssl = (uri.scheme == 'https')
http.ca_file = ENV['SSL_CERT_FILE'] if ENV['SSL_CERT_FILE'] && ENV['SSL_CERT_FILE'] != ''
http.ca_path = ENV['SSL_CERT_DIR'] if ENV['SSL_CERT_DIR'] && ENV['SSL_CERT_DIR'] != ''
http.start do |http|
http.request request
end
Expand Down

0 comments on commit 164912b

Please sign in to comment.