Module: Puppet::Network::HttpPool
- Defined in:
- lib/puppet/network/http_pool.rb
Overview
Note:
The name “HttpPool” is a misnomer, and a leftover of history, but we would like to make this cache connections in the future.
This module contains the factory methods that should be used for getting a Puppet::Network::HTTP::Connection instance.
Class Method Summary collapse
- .http_client_class ⇒ Object
- .http_client_class=(klass) ⇒ Object
-
.http_instance(host, port, use_ssl = true, verify_peer = true) ⇒ Puppet::Network::HTTP::Connection
Retrieve a connection for the given host and port.
-
.http_ssl_instance(host, port, verifier = Puppet::SSL::Validator.default_validator()) ⇒ Puppet::Network::HTTP::Connection
Get an http connection that will be secured with SSL and have the connection verified with the given verifier.
Class Method Details
.http_client_class ⇒ Object
17 18 19 |
# File 'lib/puppet/network/http_pool.rb', line 17 def self.http_client_class @http_client_class end |
.http_client_class=(klass) ⇒ Object
20 21 22 |
# File 'lib/puppet/network/http_pool.rb', line 20 def self.http_client_class=(klass) @http_client_class = klass end |
.http_instance(host, port, use_ssl = true, verify_peer = true) ⇒ Puppet::Network::HTTP::Connection
Retrieve a connection for the given host and port.
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 |
.http_ssl_instance(host, port, verifier = Puppet::SSL::Validator.default_validator()) ⇒ Puppet::Network::HTTP::Connection
Get an http connection that will be secured with SSL and have the connection verified with the given verifier
57 58 59 60 61 |
# File 'lib/puppet/network/http_pool.rb', line 57 def self.http_ssl_instance(host, port, verifier = Puppet::SSL::Validator.default_validator()) http_client_class.new(host, port, :use_ssl => true, :verify => verifier) end |