Skip to content

Commit 9f80fd7

Browse files
committed
(PUP-11428) Print default puppet and system ssl contexts at debug
Print ssl context state at debug any time one is loaded or created while making an HTTPS connection. Previously this only happened when running the SSL state machine.
1 parent 5d78d0e commit 9f80fd7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/puppet/http/client.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Puppet::HTTP::Client
2525
# used if :include_system_store is set to true
2626
# @param [Integer] redirect_limit default number of HTTP redirections to allow
2727
# in a given request. Can also be specified per-request.
28-
# @param [Integer] retry_limit number of HTTP reties allowed in a given
28+
# @param [Integer] retry_limit number of HTTP retries allowed in a given
2929
# request
3030
#
3131
def initialize(pool: Puppet::Network::HTTP::Pool.new(Puppet[:http_keepalive_timeout]), ssl_context: nil, system_ssl_context: nil, redirect_limit: 10, retry_limit: 100)
@@ -281,7 +281,9 @@ def default_ssl_context
281281
password = cert.load_private_key_password
282282

283283
ssl = Puppet::SSL::SSLProvider.new
284-
ssl.load_context(certname: Puppet[:certname], password: password)
284+
ctx = ssl.load_context(certname: Puppet[:certname], password: password)
285+
ssl.print(ctx)
286+
ctx
285287
rescue => e
286288
# TRANSLATORS: `message` is an already translated string of why SSL failed to initialize
287289
Puppet.log_exception(e, _("Failed to initialize SSL: %{message}") % { message: e.message })
@@ -425,6 +427,8 @@ def system_ssl_context
425427

426428
ssl = Puppet::SSL::SSLProvider.new
427429
@default_system_ssl_context = ssl.create_system_context(cacerts: cacerts)
430+
ssl.print(@default_system_ssl_context)
431+
@default_system_ssl_context
428432
end
429433

430434
def apply_auth(request, basic_auth)

0 commit comments

Comments
 (0)