4 ms·
That's nice to see. I was working on exactly the same thing before realizing all the corner cases and manual work involved... Unfortunately this service fails
by viraptor 12y ago
That's nice to see. I was working on exactly the same thing before realizing all the corner cases and manual work involved...
Unfortunately this service fails exactly on those cases. For example certificates signed by "/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO High-Assurance Secure Server CA" (b4c66180c520bad688470ef80bb22beba8391c22) actually have two chains. (or more) Each leads to a different CA. Each CA is included in different OS/browsers combinations, so actually you need both intermediate certs to pass validation on all current systems.
I guess you're checking the certificate against your local /etc/ssl/certs/ca-certificates.crt, which is not enough if you want to serve traffic to every OS/browser. To do that, you'd have to have a database of trusted CAs for each of them - generate the shortest chain for each, then dedup the chains, then sort the intermediates and return the chain.
I stopped at the database of trusted CAs. Without actually owning each system, it's almost impossible to obtain the certs. For example Apple provides the list for each version, but names only - without fingerprints that means hunting down CAs from foreign sites going only by names.
- agwa 12y agoThanks for the feedback. I'm using a database of CA certificates that should contain the lowest common denominator of CA certs among different OS/browsers, and picking the shortest chain that leads to these roots. I may not have given sufficient thought to cases where the chain branches and you end up with multiple roots though. However, as far as I can tell b4c66180c520bad688470ef80bb22beba8391c22 is signed by a root that's in platforms as old as Android 2.2, so a further chain from it shouldn't be necessary unless you need to support even more ancient platforms (in which case you're probably going to run into other problems with SHA-2 support, SNI, etc.).
- viraptor 12y agoI can't remember exactly which one failed, but between Android 2.x, 4.x, iOS, OSX/safari, ubuntu/ff, win7/chrome, win7/ie both chains were needed - customers noticed ssl errors. Some systems knew only about 58119f0e128287ea50fdd987456f4f78dcfad6d4 (UTN - DATACorp SGC), but comodo provided only b4c66180c520bad688470ef80bb22beba8391c22 in the intermediates package. Ssllabs website detects this and tells you both chains are required to support all browsers.
- toast0 12y agoFor your multiple chains, is this the case where the chain is example.org is signed by New CA intermediate is signed by New CA root is signed by Old CA root So agents with New CA will stop at New CA, and agents without continue on to Old CA? Or do you have an example where you have more choices than stop or continue?
- agwa 12y agoThis is how I understand chains to work in practice, and it's what the chain cert generator assumes. However, the SSL certificate ecosystem is so vast there may well be a case of chains ending up at different roots. I'd love to see an example of this. Even the cert given by viraptor, though it has two chains, ultimately ends up at a common root, "/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST Network/OU=http://www.usertrust.com/CN=UTN http://www.usertrust.com/CN=UTN - DATACorp SGC".
- viraptor 12y agoI meant the second case - one intermediate is signed by 2 "different" certs. (they have the same key of course) One is a CA, the other is intermediate itself. These are the valid chains: my cert b4c66180c520bad688470ef80bb22beba8391c22 - COMODO SSL CA 02faf3e291435468607857694df5e45b68851868 - AddTrust External CA Root Another chain. Watch out - different cert with CA in name, that is not actually a CA. It's also got the same name as the one above, but is not self-signed: my cert b4c66180c520bad688470ef80bb22beba8391c22 - COMODO SSL CA 53845e9fd070b7aa36976f536ff1441c578c63d2 - AddTrust External CA Root 58119f0e128287ea50fdd987456f4f78dcfad6d4 - UTN - DATACorp SGC You can see its interesting/messy details at https://ssl-tools.net/certificates/5yf351-addtrust-external-ca-root https://ssl-tools.net/certificates/5yf351-addtrust-external-...
- toast0 12y agoFrom the link, it looks like the AddTrust External CA is cross-signed by two different UTN Roots? UTN - DATACorp SGC and UTN-USERFirst-Hardware This is more of what I was looking for, rather than the case where you have a self-signed CA, but also a cross-signed CA. Is there a way you can create a certificate chain that you could send to two clients, one with the SGC and one with the UserFirst, and both would accept the chain as valid? (I think the answer is no, but it would be super awesome if the answer was yes)