Skip to content

Prevents spurious clientcert warnings in serverless mode #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/puppet/ssl/ssl_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down