I generate TLS certificates and sign them using a self-signed CA.
There are numerous small errors that can happen in this process and cause the certificate to get rejected. Browser seem to serve very opaque errors, which give some generic TLS error code (or worse, just "this site is under attack!") with no explanation of what exactly is wrong with the certificate chain.
Also, TLS has evolved over time, and many features that are supported by TLS software and were commonplace a few years ago are now considered insecure and not used. It is hard to keep track of these.
In a Unix/Linux environment, is there a way to test a TLS certificate to quickly figure out if it's generally in agreement with modern standards and if not, see where exactly the problem is?
openssl verify -CAfile ca.cer child.cer
does check the signature, BC and KU (if present), and if you add options revocation (CRL only), 'purpose' (EKU), policy and identity, but not all the rules browsers use; for example both Chrome/Edge and Firefox now require SAN, butopenssl
still allows subject.CN. – dave_thompson_085 Nov 14 '23 at 02:42