diff options
author | Snack Bandit <snackbandit@users.noreply.github.com> | 2013-08-27 19:52:02 +0100 |
---|---|---|
committer | Snack Bandit <snackbandit@users.noreply.github.com> | 2013-08-27 19:52:02 +0100 |
commit | dfe2cb77188bb82c72c911e6e7fda9c338baa3ae (patch) | |
tree | 38abe02dd908ba89455dfcf7efd38fd9672356a6 | |
parent | ec7acbaec778b5310261b44bad03fe11f6495b36 (diff) | |
download | bundler-dfe2cb77188bb82c72c911e6e7fda9c338baa3ae.tar.gz |
Fixing the way we load the cert and key.
Turns out, you have to read the cert into Net::Http.cert.
-rw-r--r-- | lib/bundler/fetcher.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb index 4f16c3f509..8b05046003 100644 --- a/lib/bundler/fetcher.rb +++ b/lib/bundler/fetcher.rb @@ -75,10 +75,11 @@ module Bundler @connection.verify_mode = (Bundler.settings[:ssl_verify_mode] || OpenSSL::SSL::VERIFY_PEER) @connection.cert_store = bundler_cert_store - @connection.ca_file = Bundler.settings[:ssl_ca_cert] - if Bundler.settings[:ssl_ca_cert] - @connection.cert = Bundler.settings[:ssl_client_cert] - if Bundler.settings[:ssl_client_cert] + if Bundler.settings[:ssl_client_cert] + pem = File.read(Bundler.settings[:ssl_client_cert]) + @connection.cert = OpenSSL::X509::Certificate.new(pem) + @connection.key = OpenSSL::PKey::RSA.new(pem) + end else raise SSLError if @remote_uri.scheme == "https" @connection = Net::HTTP.new(@remote_uri.host, @remote_uri.port) |