diff --git a/lib/puppet/ssl/ssl_provider.rb b/lib/puppet/ssl/ssl_provider.rb index 8b2d7a71b0..0ec6b0d932 100644 --- a/lib/puppet/ssl/ssl_provider.rb +++ b/lib/puppet/ssl/ssl_provider.rb @@ -97,12 +97,14 @@ def create_system_context(cacerts:, path: Puppet[:ssl_trust_store], include_clie cert_provider = Puppet::X509::CertProvider.new private_key = cert_provider.load_private_key(Puppet[:certname], required: false) unless private_key - Puppet.warning("Private key for '#{Puppet[:certname]}' does not exist") + msg = "Private key for '#{Puppet[:certname]}' does not exist" + Puppet.run_mode.name == :user ? Puppet.info(msg) : Puppet.warning(msg) end client_cert = cert_provider.load_client_cert(Puppet[:certname], required: false) unless client_cert - Puppet.warning("Client certificate for '#{Puppet[:certname]}' does not exist") + msg = "Client certificate for '#{Puppet[:certname]}' does not exist" + Puppet.run_mode.name == :user ? Puppet.info(msg) : Puppet.warning(msg) end if private_key && client_cert