Method: Puppet::SSL::Verifier#setup_connection

Defined in:
lib/puppet/ssl/verifier.rb

#setup_connection(http) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Configure the ‘http` connection based on the current `ssl_context`.

Parameters:

  • http (Net::HTTP)

    connection



40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/puppet/ssl/verifier.rb', line 40

def setup_connection(http)
  http.cert_store = @ssl_context[:store]
  http.cert = @ssl_context[:client_cert]
  http.key = @ssl_context[:private_key]
  # default to VERIFY_PEER
  http.verify_mode = if !@ssl_context[:verify_peer]
                       OpenSSL::SSL::VERIFY_NONE
                     else
                       OpenSSL::SSL::VERIFY_PEER
                     end
  http.verify_callback = self
end