Method: Gem::Commands::CertCommand#load_default_cert

Defined in:
lib/rubygems/commands/cert_command.rb

#load_default_certObject



245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/rubygems/commands/cert_command.rb', line 245

def load_default_cert
  cert_file = File.join Gem.default_cert_path
  cert = File.read cert_file
  options[:issuer_cert] = OpenSSL::X509::Certificate.new cert
rescue Errno::ENOENT
  alert_error \
    "--certificate not specified and ~/.gem/gem-public_cert.pem does not exist"

  terminate_interaction 1
rescue OpenSSL::X509::CertificateError
  alert_error \
    "--certificate not specified and ~/.gem/gem-public_cert.pem is not valid"

  terminate_interaction 1
end