Method: Puppet::Network::HttpPool.http_instance

Defined in:
lib/puppet/network/http_pool.rb

.http_instance(host, port, use_ssl = true, verify_peer = true) ⇒ Puppet::Network::HTTP::Connection

Deprecated.

Use #http_connection instead.

Retrieve a connection for the given host and port.

Parameters:

  • host (String)

    The hostname to connect to

  • port (Integer)

    The port on the host to connect to

  • use_ssl (Boolean) (defaults to: true)

    Whether to use an SSL connection

  • verify_peer (Boolean) (defaults to: true)

    Whether to verify the peer credentials, if possible. Verification will not take place if the CA certificate is missing.

Returns:


34
35
36
37
38
39
40
41
42
43
44
# File 'lib/puppet/network/http_pool.rb', line 34

def self.http_instance(host, port, use_ssl = true, verify_peer = true)
  verifier = if verify_peer
               Puppet::SSL::Validator.default_validator()
             else
               Puppet::SSL::Validator.no_validator()
             end

  http_client_class.new(host, port,
                          :use_ssl => use_ssl,
                          :verify => verifier)
end