Module: Puppet::Network::HttpPool Deprecated
- Defined in:
- lib/puppet/network/http_pool.rb
Overview
Deprecated.
Use HTTP::Client instead.
This module is deprecated.
Class Method Summary collapse
-
.connection(host, port, use_ssl: true, ssl_context: nil) ⇒ Puppet::Network::HTTP::Connection
deprecated
Deprecated.
Use :http instead.
- .http_client_class ⇒ Object
- .http_client_class=(klass) ⇒ Object
-
.http_instance(host, port, use_ssl = true, verify_peer = true) ⇒ Puppet::Network::HTTP::Connection
deprecated
Deprecated.
Use :http instead.
Class Method Details
.connection(host, port, use_ssl: true, ssl_context: nil) ⇒ Puppet::Network::HTTP::Connection
Deprecated.
Use :http instead.
Retrieve a connection for the given host and port.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/puppet/network/http_pool.rb', line 58 def self.connection(host, port, use_ssl: true, ssl_context: nil) Puppet.warn_once('deprecations', self, "The method 'Puppet::Network::HttpPool.connection' is deprecated. Use Puppet.runtime[:http] instead") if use_ssl unless ssl_context # TRANSLATORS 'ssl_context' is an argument and should not be translated raise ArgumentError, _("An ssl_context is required when connecting to 'https://%{host}:%{port}'") % { host: host, port: port } end verifier = Puppet::SSL::Verifier.new(host, ssl_context) http_client_class.new(host, port, use_ssl: true, verifier: verifier) else if ssl_context # TRANSLATORS 'ssl_context' is an argument and should not be translated Puppet.warning(_("An ssl_context is unnecessary when connecting to 'http://%{host}:%{port}' and will be ignored") % { host: host, port: port }) end http_client_class.new(host, port, use_ssl: false) end end |
.http_client_class ⇒ Object
15 16 17 |
# File 'lib/puppet/network/http_pool.rb', line 15 def self.http_client_class @http_client_class end |
.http_client_class=(klass) ⇒ Object
19 20 21 |
# File 'lib/puppet/network/http_pool.rb', line 19 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
Deprecated.
Use :http instead.
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) Puppet.warn_once('deprecations', self, "The method 'Puppet::Network::HttpPool.http_instance' is deprecated. Use Puppet.runtime[:http] instead") if verify_peer verifier = Puppet::SSL::Verifier.new(host, nil) else ssl = Puppet::SSL::SSLProvider.new verifier = Puppet::SSL::Verifier.new(host, ssl.create_insecure_context) end http_client_class.new(host, port, use_ssl: use_ssl, verifier: verifier) end |