Skip to content

Commit 4c7339c

Browse files
authored
Merge pull request #114 from BuddyBroker/respect-ssl-cert-file
Respect SSL_CERT_FILE environment variable
2 parents d32176d + 4c72715 commit 4c7339c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/code_climate/test_reporter/client.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def http_client(uri)
7979
if uri.scheme == "https"
8080
http.use_ssl = true
8181
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
82-
http.ca_file = File.expand_path("../../../../config/cacert.pem", __FILE__)
82+
http.ca_file = ca_file
8383
http.verify_depth = 5
8484
end
8585
http.open_timeout = CodeClimate::TestReporter.configuration.timeout
@@ -95,6 +95,10 @@ def compress(str)
9595
sio.string
9696
end
9797

98+
def ca_file
99+
ENV["SSL_CERT_FILE"] ||
100+
File.expand_path("../../../../config/cacert.pem", __FILE__)
101+
end
98102
end
99103
end
100104
end

0 commit comments

Comments
 (0)