Skip to content

Commit

Permalink
further debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
zebardy committed Jan 14, 2014
1 parent 480b2f8 commit fb70e3d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/rubygems_plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class << self
end

def new(*args)
puts "setting up constructor"
config = __new__(*args)
config.set_ssl_vars
return config
Expand All @@ -22,6 +23,7 @@ def new(*args)
end

def set_ssl_vars
puts "iinitializing ssl vars"
@ssl_verify_mode = @hash[:ssl_verify_mode] if @hash.key? :ssl_verify_mode
@ssl_ca_cert = @hash[:ssl_ca_cert] if @hash.key? :ssl_ca_cert
@ssl_ca_cert = ENV['BUNDLE_SSL_CA_CERT'] unless @ssl_ca_cert
Expand All @@ -41,7 +43,7 @@ class Gem::RemoteFetcher

def connection_for(uri)
net_http_args = [uri.host, uri.port]
$stdout.puts "running patched connection_for"
puts "running patched connection_for"

if @proxy_uri and not no_proxy?(uri.host) then
net_http_args += [
Expand Down Expand Up @@ -76,23 +78,23 @@ def configure_connection_for_https(connection)
store = OpenSSL::X509::Store.new

if Gem.configuration.ssl_client_cert
$stdout.puts "configuring client ssl cert"
puts "configuring client ssl cert"
pem = File.read(Gem.configuration.ssl_client_cert)
connection.cert = OpenSSL::X509::Certificate.new(pem)
connection.key = OpenSSL::PKey::RSA.new(pem)
else
$stdout.puts "no client cert given"
puts "no client cert given"
end

if Gem.configuration.ssl_ca_cert
$stdout.puts "configuring ca certs"
puts "configuring ca certs"
if File.directory? Gem.configuration.ssl_ca_cert
store.add_path Gem.configuration.ssl_ca_cert
else
store.add_file Gem.configuration.ssl_ca_cert
end
else
$stdout.puts "using default ca certs"
puts "using default ca certs"
store.set_default_paths
add_rubygems_trusted_certs(store)
end
Expand Down

0 comments on commit fb70e3d

Please sign in to comment.