Skip to content

Commit

Permalink
feat(pact-provider-verifier cli): allow custom certificates to be use…
Browse files Browse the repository at this point in the history
…d by setting SSL_CERT_FILE and SSL_CERT_DIR
  • Loading branch information
bethesque committed Feb 8, 2018
1 parent c82da42 commit 5cbcce1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packaging/pact-provider-verifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,17 @@ def basename
end
end

# Travelling Ruby sets its own CA cert bundle in lib/ruby/bin/ruby_environment
# and creates backup environment variables for the original SSL_CERT values.
# Restore the original values here *if they are present* so that we can connect to
# a broker with a custom SSL certificate.

if ENV['ORIG_SSL_CERT_DIR'] && ENV['ORIG_SSL_CERT_DIR'] != ''
ENV['SSL_CERT_DIR'] = ENV['ORIG_SSL_CERT_DIR']
end

if ENV['ORIG_SSL_CERT_FILE'] && ENV['ORIG_SSL_CERT_FILE'] != ''
ENV['SSL_CERT_FILE'] = ENV['ORIG_SSL_CERT_FILE']
end

Pact::ProviderVerifier::CLI::Verify.start

0 comments on commit 5cbcce1

Please sign in to comment.