CheckSSL.dev
Tools

Certificate trust · Practical guide

SSL certificate chain errors: what to investigate

A chain error means the client could not establish an acceptable path from the site certificate to a trusted authority. For “unable to get local issuer certificate” or “unable to verify the first certificate”, compare the server’s intermediates with the client’s trusted roots. An absent or outdated local trust store can fail even when the server supplies its intermediates; omitting the root from the served chain is normal. Start with the exact failing hostname and the verification output before replacing certificate files.

Compare the live handshake with an offline verification

Use OpenSSL 3 for these macOS/Linux commands. Replace example.com and prepare trusted-roots.pem from a current, trusted operating-system or organization-maintained CA bundle. Do not build that trust file from certificates downloaded from the failing server. The explicit bundle and disabled default directory/store make this comparison use the same trust anchors.

The first command sends SNI, verifies the hostname and stops on verification errors. For the second, save the observed public site certificate as leaf.pem and the relevant public intermediate certificates as intermediates.pem. Use PEM certificate blocks only. Obtain any missing intermediate through your CA’s documented distribution channel; a private key is never needed for these checks.

openssl s_client -connect example.com:443 -servername example.com \
  -verify_hostname example.com -verify_return_error -showcerts \
  -CAfile trusted-roots.pem -no-CApath -no-CAstore </dev/null

openssl verify -show_chain -purpose sslserver \
  -verify_hostname example.com -CAfile trusted-roots.pem \
  -no-CApath -no-CAstore -untrusted intermediates.pem leaf.pem
  1. Record the live verification result, certificate subject, issuer and error depth for the original hostname.
  2. Compare the offline result using the observed leaf, intended intermediates and independently trusted roots.
  3. If only the offline check succeeds, investigate the served bundle and endpoint selection, then repeat the live check after deployment.

Reference: OpenSSL 3: s_client verification and received certificates

Separate the received certificates from the trusted path

The leaf identifies the site. Intermediate CA certificates connect it to a trust anchor, usually a root already trusted by the client. A server normally sends the leaf and required intermediates; omitting the root is normal. Adding a root to the served list does not make a client trust it.

The s_client -showcerts list contains what the server sent, in its supplied order. It is not the verified path. The offline -show_chain output describes the path OpenSSL successfully built. Its “untrusted” label marks certificates supplied as chain-building material, not a failed final verification.

Without explicit trust settings, OpenSSL uses its configured locations, which vary between installations. Browsers and operating systems may use different roots or cached intermediates. A success in one client does not prove that every client can construct the same path.

Reference: OpenSSL 3: trust anchors and path construction

Use error numbers as leads, not automatic diagnoses

Read the complete message and its depth: depth zero refers to the leaf. The examples below suggest a next check, but the same incomplete deployment can produce different errors with different trust stores or chain-building results. More than one problem can exist.

Use error numbers as leads, not automatic diagnoses
OpenSSL exampleMeaningNext check
20: unable to get local issuer certificate An issuer could not be found locally. Compare the supplied intermediates and available trust anchors.
21: unable to verify the first certificate The first certificate could not be verified. Inspect the issuer path; do not assume one particular missing file.
10 A certificate has expired. Read the failing depth, certificate dates and client clock.
62 The hostname does not match. Compare the requested hostname, SAN coverage and selected virtual host.

Reference: OpenSSL 3: certificate verification errors

Deploy the right full chain at the TLS endpoint

For Nginx, the ssl_certificate file should contain the leaf first, followed by its intermediate certificates in issuer order. Use the bundle intended for this certificate. The example below belongs inside the existing HTTPS server block; replace the paths with your managed certificate files.

Keep ssl_certificate_key pointed at the matching private key with restricted access. Do not paste that key into reports or combine it with a public downloadable chain. Validate the Nginx configuration with nginx -t on the target server before the normal reload process, and preserve the certificate manager’s renewal paths.

If a CDN or load balancer terminates public TLS, change its certificate assignment or bundle there. An origin-file change does not update the edge. Compare separate public hostnames and endpoints when results disagree.

ssl_certificate     /etc/nginx/tls/example.com/fullchain.pem;
ssl_certificate_key /etc/nginx/tls/example.com/privkey.pem;

Reference: Nginx: SSL certificate chains

Finish with a verified public connection

CheckSSL may retrieve certificate details through a diagnostic handshake after verification fails. Visible dates, PEM downloads or a plausible issuer do not turn that observation into a trusted connection. Its chain view shows received certificates and does not isolate every cause of failure.

Review the separate revocation result too. Current scans attempt server-certificate verification against a signed CRL; unavailable checks remain unknown. Neither the commands above nor a trusted handshake alone establish revocation status. CheckSSL does not verify OCSP or intermediate-certificate revocation.

  1. Confirm the original hostname passes live chain and hostname verification after the deployment.
  2. Rescan CheckSSL and check trust, hostname and validity findings together.
  3. Retest an affected browser or client with its normal trust settings; keep verification enabled.

Keep reading

Related guides

All guides & reference
Quick reference

TLS certificate reference: trust, names, expiry and protocol checks

Interpret certificate and TLS findings, including unknown verification, received chains, revocation and protocol probes.

Open reference