Verifying a certificate

This is likely to cause problems. Here's an in-depth article about why: Path Building vs Path Verifying: The Chain of Pain | by Ryan Sleevi | Medium

Summary: a certificate verifier shouldn't assume that the served chain is the one true path to one specific root. Instead, consider it as a pool of helpful but untrusted certificates, which may be informative in the certificate verifier's attempt to find a path to some root that it trusts.

I would also particularly advise against using openssl verify, since its arguments are very unintuitive and hard to get right, even for experts. I've gotten it wrong a bunch of times, and so has nearly every other expert I've seen on this forum. :smiley: And even if you do get the arguments right, you still have a tool that is making the crucial incorrect assumption described in the blog post above.

My general advice would be to use the path building and verification from your TLS client library. Most TLS client libraries don't really expose that as a separate functionality, though: they just do it when negotiating a handshake.

Can you tell us more about what you're trying to do? That will help with suggesting the most appropriate solution.

18 Likes