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.
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
Fixes #36755 - Send full certificate chain to clients #874
base: develop
Are you sure you want to change the base?
Fixes #36755 - Send full certificate chain to clients #874
Changes from all commits
35f97bb
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed you're suing
foreman_ssl_ca
but you should usessl_ca_file
.foreman_ssl_ca
is used to communicate with Foreman, while falling back tossl_ca_file
.ssl_ca_file
is used to serve. So this check would be redundant.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @ekohl
I'm using
foreman_ssl_ca
intentionally.ssl_ca_file
will always contain only the internal CA. When a deployment is using self-signed certs,ssl_ca_file
andforeman_ssl_ca
are identical and contain a certificate chain that can validatessl_certificate
However, when a deployment uses custom certificates, then
ssl_ca_file
only contains internal CA whileforeman_ssl_ca
contains the CA bundle which forms the full certificate chain forssl_certificate
So, if we add
ssl_ca_file
intoSSLExtraChainCert
this will work fine for deployments with self-signed certs but will break on deployments with custom certs.If we add
foreman_ssl_ca
intoSSLExtraChainCert
it works for both use cases.With all this being said, the check to see if we can read
foreman_ssl_ca
seems necessary, just as checkingssl_ca_file
is.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but if that's the case then that's just a bug in how the installer deploys things then. The
foreman_ssl_ca
is the CA used to verify the connection to Foreman.ssl_ca_file
is the CA that must match the public and private key. I'm very firm in saying that it must bessl_ca_file
.Looking at the certs we have this bit that deploys it:
https://github.com/theforeman/puppet-certs/blob/5d7679a1add25a087d8dd925c1bae11d003852b5/manifests/foreman_proxy.pp#L95-L115
If
$proxy_key
and$proxy_cert
are signed by$server_ca_cert
, then$proxy_ca_cert
should also use$server_ca_cert
as a source.Now that I look closer, we already send
SSLCACertificateFile
so perhaps this whole PR is not needed, but the real bug is in puppet-certs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think theforeman/puppet-certs#413 is the actual fix for this bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true. As the same certificate deployed on Apache (where we got o talk to foreman) is used by foreman-proxy, it also can be used to verify the connection to foreman-proxy.
This is only true for self-signed certificates. For custom certificates, ssl_ca_file does not validate ssl_cert.pem and ssl_key.pem.
If
ssl_ca_file
is modified to include the CA bundle, which would validate ssl_cert.pem and ssl_key.pem, then we will create a problem to authenticate client connections with certificates because they are supposed to be validated againstssl_ca_file
I understand your point of view, but I just don't see a simple solution without using
foreman_ssl_ca
.Maybe deploy another file to be used as
SSLExtraChainCert
? It would need to be identical toforeman_ssl_ca
to work.Not sure why, but
SSLCACertificateFile
is not sent during the handshake, onlyssl_certificate
is (no chain at all). The entire chain is only sent when we defineSSLExtraChainCert
.This is what a client receives (original code, without my patch):
This is what it would look like with my patch:
This is what it would look like
using ssl_ca_file
:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ehelms pointed out we also do both verification of client certs (which is the default CA), so it's one I need to think further about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: perhaps we can provide the cert including the full chain in
SSLCertificate
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.