Skip to content

Commit 55e66ad

Browse files
committed
(PUP-10639) Print digest of the new CA/CRL
If we download a new bundle, then log an info message with the digest. By default, this is SHA256, unless an alternative algorithm is specified in `:digest_algorithm`.
1 parent dce5ef4 commit 55e66ad

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/puppet/ssl/state_machine.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ def download_ca(ssl_ctx, last_update)
139139
next_ctx = @ssl_provider.create_root_context(cacerts: cacerts, revocation: false)
140140
@cert_provider.save_cacerts(cacerts)
141141

142+
digest = Puppet::SSL::Digest.new(@machine.digest, pem).to_hex
143+
Puppet.info("Refreshed CA certificate: #{digest}")
144+
142145
next_ctx
143146
end
144147
end
@@ -232,6 +235,9 @@ def download_crl(ssl_ctx, last_update)
232235
next_ctx = @ssl_provider.create_root_context(cacerts: ssl_ctx[:cacerts], crls: crls)
233236
@cert_provider.save_crls(crls)
234237

238+
digest = Puppet::SSL::Digest.new(@machine.digest, pem).to_hex
239+
Puppet.info("Refreshed CRL: #{digest}")
240+
235241
next_ctx
236242
end
237243
end

0 commit comments

Comments
 (0)