method

configure_connection_for_https

Importance_0
v1_9_3_392 - Show latest stable - 0 notes - Class: RemoteFetcher
configure_connection_for_https(connection) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rubygems/remote_fetcher.rb, line 333
  def configure_connection_for_https(connection)
    require 'net/https'

    connection.use_ssl = true
    connection.verify_mode =
      Gem.configuration.ssl_verify_mode || OpenSSL::SSL::VERIFY_PEER

    store = OpenSSL::X509::Store.new

    if Gem.configuration.ssl_ca_cert
      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
      store.set_default_paths
      add_rubygems_trusted_certs(store)
    end

    connection.cert_store = store
  end
Register or log in to add new notes.