Skip to content

Commit

Permalink
Merge pull request #114 from BuddyBroker/respect-ssl-cert-file
Browse files Browse the repository at this point in the history
Respect SSL_CERT_FILE environment variable
  • Loading branch information
gdiggs authored Jun 27, 2016
2 parents d32176d + 4c72715 commit 4c7339c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/code_climate/test_reporter/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def http_client(uri)
if uri.scheme == "https"
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
http.ca_file = File.expand_path("../../../../config/cacert.pem", __FILE__)
http.ca_file = ca_file
http.verify_depth = 5
end
http.open_timeout = CodeClimate::TestReporter.configuration.timeout
Expand All @@ -95,6 +95,10 @@ def compress(str)
sio.string
end

def ca_file
ENV["SSL_CERT_FILE"] ||
File.expand_path("../../../../config/cacert.pem", __FILE__)
end
end
end
end

0 comments on commit 4c7339c

Please sign in to comment.