slop audit
Blog post 76 / Security and reliability

SSL certificate error: diagnose and fix HTTPS failures

Fix an SSL certificate error before launch: check hostname coverage, expiry, trust chains, and CDN configuration, then verify the deployed HTTPS URLs.

By Slop Audit · 7 min read

An SSL certificate error means the client could not accept the certificate presented for an HTTPS connection. The common name still says SSL, although modern HTTPS uses TLS. For a developer launching a portfolio, student project, or product website, the immediate job is to identify the failing hostname and repair its certificate delivery before reviewing page content.

Start with the exact public URL and the browser's error details. A certificate warning, an HTTP error page, and a blocked insecure image need different fixes. This guide focuses on certificates for public websites, including custom domains behind managed hosting or a CDN.

SSL certificate error troubleshooting checklist

  1. Record the failing URL, error code, time, browser, and network.
  2. Compare the certificate's names and validity dates with that hostname and the current time.
  3. Test the apex domain, www, and required asset or API hosts separately.
  4. Identify whether TLS terminates at your hosting platform, CDN, or origin server.
  5. Repair the issued certificate, served chain, or hostname assignment at that layer.
  6. Retest with certificate verification enabled from another client.
  7. Verify renewal and add a deployed HTTPS check before sharing the launch URL.

For example, https://example.com may work while https://www.example.com shows a warning. Redirecting www to the apex does not remove the need for working TLS on www: the secure connection must succeed before the client can receive the HTTP redirect.

Identify the failure before editing configuration

Open the browser's certificate details and record the names, issuer, and validity period. Capture the error text as well as the visible warning. Avoid testing by clicking through an exception, because that changes what you are validating.

Common categories include:

  • Hostname mismatch: the certificate does not cover the requested host. Check the public custom-domain assignment and the certificate actually served by that endpoint.
  • Expired or not yet valid: compare the certificate dates with a correctly synchronized client clock. Check renewal history and whether the new certificate was loaded.
  • Untrusted issuer or incomplete chain: investigate the issuing authority, intermediate certificates, and the affected client's trust store.
  • Failure only on one machine or network: compare the issuer and error with a current browser on another network. A local trust-store problem or TLS-inspecting proxy needs a different investigation from a broken public endpoint.

Mozilla's certificate warning reference explains name, date, and trust errors. These categories help you choose an investigation; an error label alone does not identify the responsible deployment layer.

If the browser receives a normal 503 page without a certificate warning, use the HTTP 503 troubleshooting guide. If the document loads but insecure dependencies fail, use the mixed content errors guide.

Check the certificate with curl

Request the failing hostname directly, keeping certificate verification enabled:

curl --verbose --connect-timeout 10 --max-time 30 \
  --output /dev/null https://www.example.com/

Read the verification error and connection details. A successful transfer can still return an unwanted HTTP status, so inspect the response status too. Do not add --insecure or -k to turn this into a passing release check.

curl's certificate documentation explains that verification checks trust and the server name. Trust sources depend on the curl build and environment. If CI fails while your laptop succeeds, record curl --version and compare the runner's CA configuration before replacing a valid public certificate.

Do not solve a public site's trust failure by asking visitors to install your private CA. Private development environments have separate trust requirements. Keep that setup separate from the public launch contract.

Fix hostname coverage and custom-domain routing

Write down every public entry hostname and its intended hosting service. Include the apex, www, and any API or asset domain used by the main task. A certificate on the hosting provider's default hostname does not establish that your custom hostname is ready.

For managed hosting, check that the exact custom domain is attached to the correct project and that certificate provisioning has completed. Confirm DNS matches the platform's current instructions. If you recently moved hosts, compare where different clients connect before treating the incident as an application regression.

For a self-managed reverse proxy, check the TLS virtual host selected for the requested name and the certificate configured there. A valid certificate for a different project still fails the intended name check. If only some requests fail, investigate separate listeners, addresses, or backends serving different certificates.

After fixing both hostnames, test the redirect destination and page response. The canonical URLs and redirects guide covers that separate URL contract. Save the failing name, hosting assignment, changed configuration, and verified result in the release record.

Repair certificate dates, chains, and renewal

An expired certificate needs a valid replacement at the endpoint visitors actually reach. Issuing a replacement without deploying or loading it leaves the public failure unchanged. For managed TLS, use the provider's certificate status and incident guidance. For self-managed TLS, inspect the renewal job, its last result, deployment hook, and service reload.

For an incomplete chain, configure the server to deliver the appropriate intermediate certificates with the leaf certificate, following your issuer and server documentation. Mozilla's trust-error troubleshooting guide specifically calls out incomplete server chains. Test from a fresh client; success in one browser is insufficient release evidence.

If automated issuance failed, investigate the validation method before repeatedly requesting replacements. Let's Encrypt's challenge documentation describes HTTP-01 validation through an HTTP token path and DNS-01 validation through a DNS TXT record. A routing rule can interfere with the former; stale or missing validation records can interfere with the latter. Use the ACME client's actual error to decide what to change.

Record who owns renewal alerts and who can repair validation. Keep an independent certificate-expiry check appropriate to your hosting setup. A page check today cannot establish that renewal will succeed later.

Separate CDN edge certificates from origin certificates

With a CDN, the browser-to-edge connection and edge-to-origin connection can use different certificates. A public browser warning concerns the certificate the browser received. An edge-generated error page can instead report that the CDN could not validate its upstream connection.

For example, Cloudflare's Full (strict) requirements require an unexpired origin certificate, an accepted issuer, and a matching origin hostname. Check that origin configuration when the public edge is reachable but reports an upstream certificate problem. A provider-specific origin certificate may be trusted by that CDN without being a public-browser certificate.

Repair the connection that fails. Weakening the CDN's validation mode can hide the symptom while changing the security contract. Retest the public URL after the origin repair, including a route that reaches the application rather than only a cached static response.

Add an HTTPS certificate testing gate to CI

After the deployment is available, check a small, explicit list of public URLs. This Bash example requires a successful verified HTTPS transfer and a final 200 for each page:

#!/usr/bin/env bash
set -euo pipefail

urls=(
  'https://example.com/'
  'https://www.example.com/'
  'https://example.com/projects'
)

for url in "${urls[@]}"; do
  if ! status=$(curl --silent --show-error --fail --location \
    --proto '=https' --proto-redir '=https' \
    --connect-timeout 10 --max-time 30 \
    --output /dev/null --write-out '%{http_code}' "$url"); then
    printf 'HTTPS transfer failed: %s\n' "$url" >&2
    exit 1
  fi

  if [[ "$status" != '200' ]]; then
    printf 'Unexpected final status %s: %s\n' "$status" "$url" >&2
    exit 1
  fi
  printf 'Verified HTTPS and final 200: %s\n' "$url"
done

Replace the examples with routes you own. The curl option reference documents redirect following, protocol restrictions, timeouts, and status output. This check deliberately rejects redirects to HTTP. Adjust the status contract explicitly for endpoints that should return something other than 200.

Run it with bash scripts/check-public-https.sh after saving the file. Keep the runner's CA certificates current and retain its output with the deployment revision. A verified 200 can still be the wrong page; keep content and redirect-destination assertions in your application smoke tests.

This gate checks the supplied URLs from one environment at one time. It does not measure certificate expiry headroom, inspect all geographic edge nodes, or verify every dependency. Repeat the check after custom-domain changes and use expiry monitoring separately.

Audit the recovered public page with Slop Audit

Once HTTPS works without a certificate exception, run Slop Audit on the recovered public route. Review the final URL's HTTPS scheme, metadata and crawl checks, and the available bounded browser evidence. Then fix the observed launch issues and rescan to compare the new report. Keep that report alongside the TLS repair and CI output as part of your website regression testing routine.

Slop Audit's HTTPS rule checks the final URL scheme. It does not provide dedicated certificate-chain inspection, expiry alerts, or renewal validation. Use the certificate checks above to establish the transport result, then use the audit to review the page visitors can finally reach.