-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Feature Request: send entire certificate chain (including root ca) #6776
Comments
Hey @hanjo, It generally is good practice to send the full chain, excluding the roots. Roots are to be installed/enabled on relying parties (e.g. client systems such as a browser), so that there's control over which roots are trusted. If a relying party were to blindly trust a root presented by a server (without additional verification) it would be equivalent to trusting any root, and thus similar guarantees as no TLS at all. So, as a web server, it's not logical to return a root certificate as part of the "full chain". The |
Hi @hslatman, that's an interesting perspective and I can understand the logic behind, although I don't really see the risk, as no browser/client is blindly trusting a root certificate which is not in their truststore and adding it to the truststore is a manual process which requires verification by the user, regardless if the new root ca was shared by caddy or manually imported. I'd like to elaborate my requirements some more, maybe that clarifies things: Therefore, I still believe such a configuration option would be beneficial, albeit I agree that by default this should probably be disabled, like it is now. |
Seems like an elaborate way to shoot yourself in the foot? It's an intermediate certificate, just treat it like that. |
It might be worth considering that there are specific scenarios where having the option to send the entire certificate chain could add value, like I tried to point out. This feature request aims to address those use cases, providing flexibility for users who need it. |
I'm not sure I'm convinced.
So you have:
and I think if a client is presented with |
Thanks @mholt for entertaining this idea.
This is exactly the scenario. The client trusts "Root", so in turn any certificate where "Root" is the issuer is also trusted. When the client requests the site through caddy, caddy will present the two certificates "Leaf" and "Intermediate 2". "Leaf" is issued by "Intermediate 2", so not trusted (yet). "Intermediate 2" is issued by "Intermediate 1", so not trusted (yet). "Intermediate 1" is unknown to the client (because it is neither in the trust store, nor has it been sent by caddy) and thus the client does not know by whom it's been issued. Therefore, also "Intermediate 2" and "Leaf" remain untrusted. So there are two solutions to this issue: either I put "Intermediate 1" in the client's truststore, or the webserver (caddy in this case) needs to send also the public part of "Intermediate 1" along with the other two. |
Why not just give Caddy the intermediate? It's already established that Caddy sends leaf and intermediate, and your issue is because you've created a disjoint in the chain by creating an additional intermediate yet serves no purpose. |
It does serve a purpose, namely being compatible with an existing PKI. Not all certificate chains contain just a single intermediate; two or more is a perfectly valid configuration, albeit more complex (in terms of management). In general web servers do support such configurations, and it's indeed as @hanjo describes by also sending additional intermediates required to form a chain to one (or more) trusted root(s). The longer chain still shouldn't include roots, generally, though. @hanjo: now that you describe it as an intermediate it indeed does make sense. It's an important distinction (vs. a root), hence my initial comment. I haven't tested/tried it, but I suppose it can be made to work by letting the intermediate PEM file contain multiple intermediate certificates (this would require some plumbing of the slice of |
Hi,
I noticed that caddy will present the intermediate ca certificate and the host certificate when accessing it. This can be checked with openssl, for example:
Here is an example with an internal pki:
In this example "1" is the intermediate ca certificate and "0" is the host certificate.
This is usually working fine, as long as the client (i.e. browser) knows and trusts the root ca certificate. However, if the certificate chain is more complex (i.e. longer), this can cause trouble, because the browser wouldn't be able to fill any gaps in the certificate chain presented by caddy.
To fix this, caddy would need to present the entire certificate chain - including the root ca certificate - to the client. I checked the documentation, but I could not find an option to enable this.
So far, I've been under the impression that it is good practice to include the entire certificate chain, which is also done by many (though not all) popular public websites, for example GitHub:
As you can see, "2" is the root ca certificate, "1" is the intermediate ca certificate and "0" is the host certificate.
Therefore, I'd like to request a configuration switch to enable sending the root ca certificate in the certificate chain.
Let me know what you think.
Thanks!
The text was updated successfully, but these errors were encountered: