4 ms·
I hope the day never comes when I have to really understand what is going on with certificates. Every time I get close to it, it seems to be a shifting maze of
by recursive 3y ago
I hope the day never comes when I have to really understand what is going on with certificates. Every time I get close to it, it seems to be a shifting maze of smoke and mirrors.
- ilyt 3y agoAll you need to know and care for is that cert is signed by CA that your app has in cert store, and have the right fields that your app wants/uses (usually for web use just CN and Subject Alternate Names[SAN]). Everything else is basically smoke and mirrors
- matheusmoreira 3y ago"Shifting maze of smoke and mirrors" is a surprisingly accurate description of the digital certificate mess. It looks like everyone just trusts the governments and corporations involved. I'd rather not even think about the implications and just assume it's better than literally nothing.
- agwa 3y agoWe definitely don't "just" trust the certificate authorities. Considerable effort is spent monitoring CAs for non-compliance, and CAs which are found untrustworthy are booted.
- matheusmoreira 3y agoI'm not sure those efforts amount to anything, no matter how considerable. Some nation state can probably just scream national security and compromise the whole thing, complete with gag orders preventing people from blowing the whistle.
- agwa 3y agoTransparency is not optional - Chrome and Safari don't accept certificates that aren't published in Certificate Transparency logs. Certificate Transparency logs use Merkle Trees so that if they try to hide a certificate, it can be detected. The system is designed to resist subversion, even by governments. While there are scenarios where a sufficiently-powerful attacker could successfully subvert the system, they run a high risk of being detected if they try. It's just not as simple as you imply.
- bavell 3y agoI'd love to see some good links/resources to read up on this area more. What are all the feedback mechanisms the CA ecosystem uses to resist subversion and bad actors?
- matheusmoreira 3y agoI didn't know about certificate transparency. Thanks, I learned something today.
- vilunov 3y agoIt already [almost] happened twice. Kazakhstan had plans to introduce country-wide MITM with certificates signed by a government agency, whose root certificate would have had to be marked as trusted if you wanted to use internet [1]. Many Russian government websites including the largest retail bank had their certificates revoked due to sanctions, which forced the government to start their own untrustworthy certificate center, whose root CA is trusted out of the box by Yandex Browser and has to be trusted if you wanted to access these sites [2]. [1]: https://en.wikipedia.org/wiki/Kazakhstan_man-in-the-middle_attack https://en.wikipedia.org/wiki/Kazakhstan_man-in-the-middle_a... [2]: (In Russian) https://www.gosuslugi.ru/tls https://www.gosuslugi.ru/tls
- perlgeek 3y agoI feel similarly frustrated. The basics of CAs, trust chains and certificates are pretty easy to understand once you're roughly aware of public key cryptography. But then you get into the arcane and confusing details of which fields hold which information, the various serialization formats, confusing error messages when servers don't provide their intermediates, other software simply not dealing with intermediates (I'm looking at you, etcd) and on and on. A "fun" example: I have an openvpn client config that contains, among other things, this here: <pkcs12> -----BEGIN CERTIFICATE----- (base64-looking stuff here) -----END CERTIFICATE----- </pkcs12> This contains, confusingly, not just a certificate but also an encrypted private key. I wanted to change the encryption password, but it turns out that "openssl pkcs12" cannot actually read that block, because it turns out to be a base64-encoded DER format or some other shit. WAT?
- lilyball 3y agoThat text block is PEM. Putting PEM in a tag that says <pkcs12> is awfully strange (PKCS#12 is a binary format anyway). And are you saying there's a private key inside of the base64 data? Or, oh no, please don't tell me that the PEM block contains PKCS#12?? A PEM CERTIFICATE block is supposed to contain a single DER-encoded certificate.
- endofreach 3y agoMight be OT, but it looks like a rocket!
- lilyball 3y agoIncidentally I believe you should be able to use `openssl asn1parse -inform PEM` to read that block and print out the DER-encoded ASN.1 structure, which can be used to help identify what's in there.