class Gem::Net::HTTP::Persistent

def ssl connection

def ssl connection
  connection.use_ssl = true
  connection.ciphers     = @ciphers     if @ciphers
  connection.ssl_timeout = @ssl_timeout if @ssl_timeout
  connection.ssl_version = @ssl_version if @ssl_version
  connection.min_version = @min_version if @min_version
  connection.max_version = @max_version if @max_version
  connection.verify_depth = @verify_depth
  connection.verify_mode  = @verify_mode
  if OpenSSL::SSL::VERIFY_PEER == OpenSSL::SSL::VERIFY_NONE and
     not Object.const_defined?(:I_KNOW_THAT_OPENSSL_VERIFY_PEER_EQUALS_VERIFY_NONE_IS_WRONG) then
    warn <<-WARNING
                           !!!SECURITY WARNING!!!
e SSL HTTP connection to:
#{connection.address}:#{connection.port}
                         !!!MAY NOT BE VERIFIED!!!
 your platform your OpenSSL implementation is broken.
ere is no difference between the values of VERIFY_NONE and VERIFY_PEER.
is means that attempting to verify the security of SSL connections may not
rk.  This exposes you to man-in-the-middle exploits, snooping on the
ntents of your connection and other dangers to the security of your data.
 disable this warning define the following constant at top-level in your
plication:
I_KNOW_THAT_OPENSSL_VERIFY_PEER_EQUALS_VERIFY_NONE_IS_WRONG = nil
    WARNING
  end
  connection.ca_file = @ca_file if @ca_file
  connection.ca_path = @ca_path if @ca_path
  if @ca_file or @ca_path then
    connection.verify_mode = OpenSSL::SSL::VERIFY_PEER
    connection.verify_callback = @verify_callback if @verify_callback
  end
  if @certificate and @private_key then
    connection.cert = @certificate
    connection.key  = @private_key
  end
  connection.cert_store = if @cert_store then
                            @cert_store
                          else
                            store = OpenSSL::X509::Store.new
                            store.set_default_paths
                            store
                          end
end