Prevents spurious clientcert warnings in serverless mode #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When there are no clientcerts, Puppet will warn when it creates an
SSLContext
for HTTPS operations. This situation occurs when you runentirely serverless and never generate clientcerts. It's spurious in
that case, so we don't actually need to warn about it.
This behaviour was added in 3f7f830
so that the new HTTP client could download files via HTTPS from the
puppetserver (for example, the way that pe_repo) works.
To prevent this being a failure when running
puppet apply
inserverless mode, it explicitly marks the clientcerts as optional in
puppet/lib/puppet/ssl/ssl_provider.rb
Line 98 in 06bc441
and
puppet/lib/puppet/ssl/ssl_provider.rb
Line 103 in 06bc441
This goes one step further and sets the output to
INFO
rather thanWARN
when running
puppet apply
.This does have one small edge case. If,
puppet agent -t
you runpuppet apply
forprovisioning purposes, and
puppetserver
Then you will get a certificate validation error and the HTTPS request
will fail silently with only an
INFO
message as a hint explaining why.To fix it, you obviously just generate and sign the clientcerts.
I think this is an acceptable tradeoff, but would like other opinions.
This will need specs before merging.
Fixes #21