3 ms·
Your end entity cert was signed by some specific intermediate CA yes. And that intermediate is often (always?) only signed by one CA. But that CA may have signe
by toast0 5y ago
Your end entity cert was signed by some specific intermediate CA yes. And that intermediate is often (always?) only signed by one CA. But that CA may have signed certificates from multiple other CAs (generally this is known as cross signing).
If your client doesn't trust the CA that signed the intermediate that signed your cert, you'll need a cross signed CA cert that works for your clients, but sometimes it's not possible to make a single chain that supports all the clients you want. And it's difficult to differentiate (and even if you can figure out how to differentiate, you're probably going to be patching your TLS server to do it, because it's not widely supported).
When you consider poor client behavior, you get situations like client A doesn't have your CA, but does have another you can cross chain to; client B has your CA and not that other one and has poor verification logic, so if you include the cross chain, verification will fail; you can't make both clients work with the same chain (unless you switch to a different CA). My personal favorite though is when the client helpfully supplies a cached cross chain, but the certificate expired, so it fails validation... even though you didn't send that cert, and you have a path it would validate if it didn't have the cached certificate.
I'm exceedingly glad I don't have to deal with this anymore. But at least TLS1.3 changed the spec to require(i think) clients to handle out of order or extraneous certs which strongly suggests clients should try all possible paths and pass the validation if any are valid. Still no way to present multiple end entity certificates though (end entity must be the first certificate, you couldn't send two full chains)
- hamburglar 5y agoThe issue from TFA was a simple matter of not including an intermediate at all, not confusion about which intermediate you should include when cross-signing (the article says the intermediate wasn't included, and there is no mention of cross-signing at all). Either way, the proper solution is "include all the intermediates," which applies to cross-signing scenarios. The client will find the path from leaf to any root it trusts. If you had some kind of crazy number of alternate paths for a given cert, this might become onerous, but in reality, the number of alternate paths is basically always either zero or one.
- cipherboy 5y agoIn general, we don't actually have enough information to tell this. :-) Consider the case of an older Android client (not from TFA, but bear with me), using certs from Let's Encrypt: https://letsencrypt.org/certificates/ https://letsencrypt.org/certificates/ On an older server install, it could be the server was setup with a manual R3->leaf trust, serving (at the time) both copies of R3. This would've been within TLS spec: https://datatracker.ietf.org/doc/html/rfc8446#section-4.4.2 https://datatracker.ietf.org/doc/html/rfc8446#section-4.4.2 as you are within rights to omit roots: > a certificate that specifies a trust anchor MAY be omitted from the chain, provided that supported peers are known to possess any omitted certificates. Both ISRG Root X1 and DST Root CA X3 are well-known roots, and so might be omitted by an operator. ACME does its thing, but this (admittedly misconfigured) server only updates the leaf cert. However, original copy of DST->R3 expires. While we have two intermediates in the served chain, because our client relies on the DST trust root, it can't validate it because the cross-signed ISRG Root X1 is missing. But when browsing to a correctly-configured LE-based server (serving the cross-signed ISRG Root X1), this will prime the intermediate cache and allow validation to succeed. And from the PoV of the old Android based client, this would look like an intermediate is missing (because it doesn't trust the self-signed ISRG Root X1 but does the cross-signed copy). My 2c, but its entirely plausible (with public CAs) that this could be the case if one of these installations is out of date.
- cipherboy 5y agoThis is almost all correct, but note that the new TLSv1.3 CertificateAuthoritiesExtension is optional (MAY): https://datatracker.ietf.org/doc/html/rfc8446#section-4.2.4 https://datatracker.ietf.org/doc/html/rfc8446#section-4.2.4
- toast0 5y agoDoes anyone actually use that extension? There was an earlier extension with the same general purpose, but AFAIK, nobody used that either. The big difference is https://datatracker.ietf.org/doc/html/rfc8446#section-4.4.2 https://datatracker.ietf.org/doc/html/rfc8446#section-4.4.2 calling out that the certificate list is unordered, and suggests that clients SHOULD be prepared to handle that in TLS 1.2 as well.
- sidewndr46 5y agoI believe this comment accurately portrays why TLS is a quagmire that despite being built on reasonable cryptographic primitives winds up being compromised by whatever flavor-of-the-month vulnerability is out there.
- toast0 5y agoI'm not sure anyone can declare X.509 certificates to be a reasonable primitive with a straight face. :P I don't know that there's anything better, and they were certainly convenient, but so many options, so many ways to mess things up.