HTTPS Certificate Errors Explained: Diagnose TLS Problems Before Renewal or Migration
HTTPSTLSSSL certificatesOpenSSLInfrastructure

HTTPS Certificate Errors Explained: Diagnose TLS Problems Before Renewal or Migration

FFlorence Cloud Editorial Team
2026-12-01
8 min read

Diagnose HTTPS certificate errors with a practical checklist covering expiration, hostname mismatches, chains, DNS, SNI, TLS, and trust stores.

An HTTPS certificate error does not always mean that a certificate needs renewal. This checklist shows how to separate expiration, hostname, certificate-chain, DNS, SNI, protocol, and local trust problems using browser details, curl, and OpenSSL before changing production configuration.

Overview

HTTPS works when several independent pieces agree: the domain must resolve to the intended endpoint, the server must present a certificate for the requested hostname, the certificate must be within its validity period, the server must provide a usable chain to a trusted root, and the client must support an acceptable TLS connection. A failure in any one of these areas can produce a browser warning or a command-line error.

Start by recording the exact hostname and URL that fail. example.com and www.example.com may use different DNS records, load balancers, or certificates. Also note whether the failure affects every visitor, one network, one device, or only an automated client. That scope is often more useful than the wording of the browser message.

Use this order for an efficient TLS troubleshooting workflow:

  1. Confirm the URL and the hostname the client is requesting.
  2. Check DNS and the endpoint receiving the request.
  3. Inspect the certificate’s subject, alternative names, dates, issuer, and chain.
  4. Test with a client that displays the underlying TLS error.
  5. Check SNI, protocol versions, cipher compatibility, and local trust stores if the server appears correct.

Do not disable certificate verification as a permanent fix. An option that makes a test command succeed can hide the exact problem that browsers and other clients are correctly reporting.

Checklist by scenario

1. The certificate is expired or not yet valid

Inspect the certificate currently served by the public endpoint rather than relying only on the certificate file stored on a server. The file may be valid while a load balancer, reverse proxy, CDN, or older application node continues to serve a different certificate.

openssl s_client -connect example.com:443 -servername example.com -showcerts < /dev/null

Look for the notBefore and notAfter values in the output. If the certificate is expired, identify which component terminates TLS and renew or replace the certificate there. If it is not yet valid, check the system clock on the client and the server, then verify that the newly issued certificate was deployed to the intended endpoint.

After replacement, test every public hostname and confirm that all production instances have converged. A rolling deployment can leave one node with the old certificate.

2. The hostname does not match

A certificate must cover the hostname in the URL, normally through the Subject Alternative Name extension. A certificate for example.com does not automatically cover www.example.com, and a certificate for one subdomain does not generally cover a different subdomain.

Inspect the names presented by the endpoint:

openssl s_client -connect www.example.com:443 -servername www.example.com < /dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -dates -ext subjectAltName

Compare the requested hostname with the listed alternative names. If the names are correct but the error persists, check whether a redirect sends users to another hostname that lacks coverage. Review both the initial URL and every HTTPS destination in the redirect path.

3. The chain is incomplete or untrusted

Servers commonly need to send the leaf certificate together with the intermediate certificates required by clients. The root certificate is normally supplied by the client’s trust store, while the server should provide the intermediate chain. An incomplete chain can work on one device and fail on another because some clients have cached or separately installed intermediates.

Use OpenSSL to request verification and display the chain:

openssl s_client -connect example.com:443 -servername example.com -showcerts -verify_return_error < /dev/null

Read the verification error carefully. A missing issuer, an unknown authority, and a hostname mismatch point to different fixes. Install the certificate bundle in the format required by the TLS terminator, then reload or restart that component according to its deployment process. Avoid assembling a chain by guesswork; use the bundle supplied by the certificate issuer or the documented configuration for your hosting platform.

4. DNS points to the wrong service

If a domain recently moved hosts, DNS may still direct some resolvers to an old server. Query the relevant records and compare the returned addresses with the infrastructure you expect:

dig example.com A
dig example.com AAAA
dig www.example.com CNAME

Check both IPv4 and IPv6. A correct IPv4 endpoint does not help if some clients reach an IPv6 address serving a different certificate. Also check CNAME targets, DNS provider settings, and any proxy or CDN layer. For a broader reference on record roles and troubleshooting, see DNS Records Explained.

When testing a migration, you can inspect a specific endpoint without changing public DNS by using a controlled hosts-file entry or a tool that connects to an address while preserving the requested hostname. Keep such overrides temporary and documented.

5. SNI selects the wrong certificate

Server Name Indication lets one TLS endpoint serve different certificates for different hostnames. Always include -servername in OpenSSL tests. Without it, a server may return its default certificate, creating a misleading hostname mismatch.

Compare these two tests:

openssl s_client -connect 203.0.113.10:443 -servername example.com < /dev/null
openssl s_client -connect 203.0.113.10:443 < /dev/null

If the certificate changes, the endpoint uses name-based selection. Confirm that the requested hostname is configured on the load balancer, ingress controller, web server, or CDN, and that the certificate is attached to the correct listener.

6. The server and client cannot agree on TLS settings

Some errors occur after certificate selection, during protocol or cipher negotiation. Test with verbose curl output:

curl -vI https://example.com/

Look for the connection address, TLS handshake messages, selected protocol, certificate subject, and the final verification error. If an older client fails while current browsers succeed, check the client’s TLS support and trust store before weakening the server configuration. If all clients fail after a server change, review listener settings, protocol configuration, and recent infrastructure deployments.

7. Only one device or network reports the error

A device-specific failure often involves an outdated operating-system trust store, a managed proxy, antivirus HTTPS inspection, an incorrect system clock, or a locally installed root certificate. Test from another network and an independent machine. On managed systems, ask whether outbound HTTPS is being intercepted and whether the organization requires a private certificate authority.

If command-line tools and browsers disagree, compare their trust stores and proxy settings. Do not copy a private organizational root certificate into public servers or unrelated machines.

What to double-check

  • Every hostname: Test the apex domain, www, API subdomains, regional names, and any hostname used by health checks.
  • Every path to production: Check the CDN, WAF, load balancer, ingress, reverse proxy, and application server. TLS may terminate before the application.
  • Both address families: Verify A and AAAA records independently.
  • The served certificate: Inspect the live endpoint, not only a certificate file or secret in source control.
  • Renewal automation: Confirm that the ACME client or certificate workflow can complete validation, write the new files, reload the TLS service, and report failures.
  • Permissions and paths: Ensure the service can read the key and certificate files, and that configuration points to the intended version.
  • Redirects: Test HTTP-to-HTTPS and hostname redirects separately so a valid first connection does not conceal an invalid destination.
  • Monitoring: Alert before expiration and include hostname, endpoint, issuer, validity dates, and chain verification in the check where possible.

When certificates are changed as part of a deployment, make the reload and verification steps observable. A deployment guide such as this GitHub Actions workflow for Node.js apps can help structure secure, repeatable release steps, while containerized services should verify that certificate mounts and reload behavior survive replacement.

Common mistakes

  • Renewing before identifying the failure: Renewal will not fix a DNS mismatch, wrong SNI configuration, or missing intermediate certificate.
  • Testing without SNI: An OpenSSL command that omits -servername may inspect the default certificate instead of the one users receive.
  • Checking only one hostname: A certificate can be correct for the main site and wrong for an API or redirect target.
  • Ignoring IPv6: An AAAA record can send a portion of traffic to an unconfigured or outdated endpoint.
  • Installing a root certificate on the server: This does not replace the intermediate chain that the server needs to present.
  • Using insecure bypasses in production: Disabling verification in curl, an SDK, or a browser may conceal an active configuration problem.
  • Forgetting the reload: Writing new certificate files does not necessarily make a running process use them.
  • Relying on browser cache: Reproduce the issue with a clean client or command-line test, but treat cached results as clues rather than proof.

When to revisit

Revisit this checklist before certificate renewal windows, domain migrations, DNS changes, CDN or load-balancer replacements, new subdomain launches, and major operating-system or runtime updates. It is also worth reviewing before seasonal planning cycles, when teams can verify ownership, expiration alerts, renewal credentials, and recovery procedures without production pressure.

Update the runbook when your certificate authority, ACME client, hosting provider, ingress controller, or trust-store process changes. Record the current TLS termination points, responsible owners, renewal method, test commands, and rollback procedure. Keep a non-production hostname available for validating configuration changes before they reach the public service.

For the next HTTPS alert, capture the exact hostname, timestamp, resolver result, endpoint address, browser error, curl -vI output, and OpenSSL verification result. Then classify the issue as validity, hostname, chain, DNS, SNI, protocol, or local trust. That small evidence set turns a vague SSL certificate chain error into a bounded infrastructure task—and helps prevent the same error from returning at the next migration or renewal.

Related Topics

#HTTPS#TLS#SSL certificates#OpenSSL#Infrastructure
F

Florence Cloud Editorial Team

Infrastructure and Developer Tools Editors

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.