Validating a certificate
A chain that ends at a trusted root shows who issued a certificate. Validation asks several more questions, each with its own failure, and a client that skips them accepts whoever answers.
More than a valid signature
Every time Ava orders prints, Lab Photos' server sends the order to the printing service at api.printer.example over HTTPSHTTP protected by TLS, so traffic is encrypted and checked for changes while it travels. It protects the connection, but does not prove that the site at the other end is honest.. The printing service's server presents a certificate chain, and Lab Photos' HTTPThe Hypertext Transfer Protocol, the rules browsers, apps, and servers use to send requests and responses on the web. client has to decide whether to continue. Ava's browser makes the same decision whenever it connects to photos.example. With the mutual TLSTransport Layer Security, the protection behind HTTPS. It encrypts traffic between two connected systems, detects changes on the way, and uses certificates so the client can confirm which server it reached. from HTTPS and certificates in practice, the server makes it too: it asks the client for a certificate and checks that one the same way.
A chain that ends at a trusted root only shows that a trusted CA issued the certificate. The client still needs to know that the certificate is current, that it names the server it meant to reach, that it was issued for this use, that nobody has withdrawn it, and that the server actually holds the matching private key. Most of this is handled by the TLS library, but knowing what it checks makes its errors understandable and its configuration less mysterious.
The checks
Each check answers a different question, and passing one says nothing about the others. The chain check asks whether a path of valid signatures leads from this certificate to a root the client trusts, with every issuerThe party that creates and signs a token, assertion, or certificate, named in a token's iss claim. A recipient must check that the issuer is exactly the one it expected and trusts. on the way marked as a CA and within its path length and name constraints, as Certificate authorities and chains described. The validity check asks whether the current time is between each certificate's not-before and not-after times. The name check asks whether api.printer.example matches a name in the subject alternative names, and the permitted use check whether the key usage and extended key usage allow TLS server authenticationChecking evidence that someone, or some application, controls an account, such as a password or a passkey. It establishes which account is being used, not what that account may do..
Two checks look beyond the certificate's own fields. Revocation asks whether the issuer has said that a certificate in the chain should no longer be trusted. Proof of the private key asks whether the server signed the handshake with the private key that matches the certificate's public keyThe half of a key pair that can be shared freely. It checks signatures made with the matching private key and can encrypt data that only that private key can decrypt.. That last check happens during the TLS handshake rather than by reading the certificate, and it is what separates the printing service's server from anyone who merely copied its public certificate.
api.printer.example
- Issuer
- Example Issuing CA 1
- Validity
- Not after 2026-09-28 23:59:59 UTC
- Name
- DNS:api.printer.example
- Extended key usage
- TLS server authentication
- Serial number
- The number a CRL would list
- Public key
- EC P-256
Certificate has expired
What fails, and how OpenSSL says so
- Chain to a trust anchor
- 20: issuer not found
- Validity period
- 10: expired, 9: not yet valid
- Name
- 62: hostname mismatch
- Permitted use
- 26: unsuitable purpose
- Revocation
- 23: revoked
- Proof of the private key
- The handshake fails
Every check must pass. The client stops at the first that fails.
Many HTTP clients skip revocation unless the application turns it on.
The name check depends on the client knowing which name it intended. An HTTP client connecting to a URLA web address, such as https://photos.example/api/albums/42?limit=10. It names how to connect (https), the domain, the path to a particular page or resource, and any extra parameters after the question mark. knows the hostname from the URL. Code that opens a TLS connection to an IP address or builds a socket by hand may not, and a missing expected name means the certificate for any site signed by a trusted CA would pass. When given a hostname, well-maintained HTTP clients perform every check by default except revocation, which many of them skip unless the application turns it on. Checking revocation explains why.
Reading a failure
When a check fails, the client stops before sending any request data. These illustrative messages show the kinds of errors failed checks produce. Exact wording varies between libraries.
api.printer.example: certificate has expired
(not after: 2026-09-28 23:59:59 UTC)
api.printer.example: hostname mismatch
(certificate names: shop.printer.example, www.printer.example)
reports.photos.example: unable to get local issuer certificate
(issuer: Lab Photos Internal CA)The first error means the printing service's certificate expired yesterday and was not renewed, which the printing service needs to fix. The second means the client reached a server whose certificate does not cover the name it requested. That could be a misconfigured server, or it could be the wrong server entirely. The third means the client could not build a chain to any root it trusts. Here the issuer is Lab Photos' own private CA, which this client has not been configured to trust.
Checking revocation
A certificate can stop being trustworthy before it expires, most importantly when its private key is exposed. The CA can revoke it and publish that decision. The long-standing way to publish is a certificate revocation list (CRL): a list of revoked serial numbers, signed by the CA, with the time it was issued and the time by which a newer one will be. Clients download it from the address in the certificate. The Online Certificate Status Protocol (OCSP) was added later, so a client could ask the CA about one certificate at a time, and with OCSP stapling the server fetches a short-lived signed answer about its own certificate and presents it during the connection.
Reading a downloaded list is not yet a revocation check. Before relying on the absence of a serial number, the client must establish that the CRL is signed by the authorized issuer, applies to this certificate and is current under its update times and local policy. A stale, unrelated or unverified list gives no reliable answer.
Revocation checking has practical limits. Lists can be large, status servers can be slow or unreachable, and asking the CA about every site a person visits reveals their browsing. Clients that do check often soft-fail: if they cannot get a status, they continue. That makes the check easy to defeat for an attacker who can block it. Many HTTP clients and TLS libraries skip the check entirely unless an application enables it, so Lab Photos' HTTP client may never ask about the printing service's certificate at all.
Those problems have pushed the public web away from asking about each site. Publicly trusted CAs must publish CRLs, while OCSP has become optional and some large CAs have stopped offering it. Browsers increasingly gather CAs' lists themselves and send their users compact summaries. Certificate lifetimes are also falling, so a compromised certificate stops working soon even when revocation is missed.
When verification is turned off
Faced with the third error above, a developer might reach for a setting that disables certificate verification. Every HTTP library has one:
# Avoid: each of these accepts any certificate from anyone
requests.get(url, verify=False) # Python
NODE_TLS_REJECT_UNAUTHORIZED=0 node report.js # Node.js
curl --insecure https://reports.photos.example/The error goes away because the client no longer checks anything. The connection is still encrypted, but to whoever answered. Anyone who can intercept the traffic, on a shared network or through a compromised router, can present their own certificate and read or change everything, including credentials. Settings like this also tend to outlive the test that needed them and reach production.
The fix is to give the client the trust it is missing, and only that trust. For the internal service, the client can be configured to trust Lab Photos' private root for that connection, as curl --cacert did in HTTPS and certificates in practice:
requests.get(url, verify="/etc/labphotos/internal-root-ca.pem")For an expired or misnamed certificate, the client has nothing to add: the fix belongs on the server, which needs a renewed certificate or one that lists the right names.
Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- Verify a certificate and diagnose each refusalBuild a teaching CA from a sourced script, loop over refusals that each change one condition, verify against a signed current CRL, and see what turning verification off accepts.