Users cannot open the site: certificate or DNS?
Browsers warn that the connection is not private
Troubleshooting, Easy
On call, at 08:10 on Sunday customers say shop.example.org does not open. Browsers show "Your connection is not private". You know:
- The outside monitor has failed with a TLS error since about 00:00 UTC. The internal address without TLS returns 200.
- dig +short shop.example.org returns 203.0.113.40, the load balancer, as always.
- A free authority issued the certificate 90 days ago. It sits on the web server (the load balancer only passes traffic). A nightly cron job runs renew.
- A firewall rule changed 5 weeks ago. Nobody linked it to this site.
List your first steps in order (who you tell, then your checks) with evidence. Then give the cause, the fix, the proof and the prevention.
Examples
openssl s_client -connect shop.example.org:443 -servername shop.example.org </dev/null | openssl x509 -noout -dates -subjectsudo tail -n 20 /var/log/letsencrypt/letsencrypt.logdig +short shop.example.orgConstraints
- You have shell access to the server and read access to DNS. The renew cron job runs as root.
- Rotating the certificate is allowed. Changing DNS is allowed but not needed unless the checks show it.
- Do not turn off TLS or tell users to ignore the warning.
Your answer must contain
- Who you tell, then an ordered list of checks, and the evidence each check gives
- How you tell an expired certificate from a DNS problem
- The cause, the fix and how you confirm it
- What you change so it does not happen again
A strong answer covers A strong answer separates expiry from DNS with curl and openssl, finds the failed renewals behind the firewall rule, renews and reloads, and adds an expiry alert.
Hints
Try the problem first. Open one hint at a time.
Hint 1 a nudge
Reproduce from outside first. The error text tells you which layer fails: name lookup, certificate or connection.
Hint 2 the approach
The name resolves to the right address. Read the certificate the server presents, with its dates, and compare the end date with the start of the errors.
Hint 3 the key step
If the certificate expired, ask why the nightly renew job failed, and what changed five weeks ago. Fix both, reload the server, and test from outside.
Walkthrough
Full walkthrough brute force to best
First minutes, in order
The checks, in order. 1. Tell people you are on it, with the impact (all customers cannot open the site) and the start time. 2. Reproduce from outside with curl -vI https://shop.example.org. The message tells the layer: could not resolve host or a wrong address means DNS, certificate has expired means the certificate, and connection timed out means the network or a firewall. 3. Check DNS with dig +short shop.example.org. It returns 203.0.113.40, the load balancer, so DNS is right. 4. Read the certificate with openssl s_client and x509 -noout -dates -subject. It shows an end date of Oct 25 at 00:00 UTC, which matches the start of the failures.
Narrow down the cause
How to tell the causes apart: a wrong DNS answer gives no address, NXDOMAIN or the address of another host, and a name mismatch error also points there. An expired certificate shows a past end date for the right name. A firewall or network problem gives a timeout and no certificate at all.
Cause and fix
Cause: the certificate expired at midnight UTC. The nightly renew job had failed for weeks with no visible alarm. A 90-day certificate is renewed from day 60, so the first failed run was about 4 weeks before expiry. The firewall rule from 5 weeks ago is the first suspect: it may have blocked port 80 for the certificate authority check, so each renew run stopped at validation. Confirm it in the renew log, which should show a timeout during connect, and in the rule itself. Fix: allow the validation port again, or use DNS-based validation. Run certbot renew once, reload the web server so it uses the new files, and check that the chain is sent with the certificate.
Read the evidence
Read the evidence. The certificate shows a start date of Jul 27 and an end date of Oct 25, so it ended at the start of the failures. The renew log shows an error on every run for the last 29 days. dig shows the load balancer address, as before, so DNS is not the cause. The load balancer only passes traffic through, so the certificate on the web server is the one customers see.
Commands
curl -vI https://shop.example.org
dig +short shop.example.org
echo | openssl s_client -connect shop.example.org:443 -servername shop.example.org 2>/dev/null | openssl x509 -noout -dates -subject
sudo tail -n 20 /var/log/letsencrypt/letsencrypt.log
sudo certbot renew
sudo nginx -s reloadConfirm and prevent
Confirm: openssl shows an end date about 90 days away, curl -vI returns 200 with no error, the outside monitor turns green, and a fresh browser opens the site. Prevent: alert when a certificate has less than 14 days left, alert when the renew job fails, run certbot renew --dry-run after every firewall change, and note the validation port on the firewall change.
Common mistakes
- Changing DNS with no evidence.
- Telling users to click through the warning, or turning TLS off.
- Renewing the certificate but not reloading the web server.
- Having no way to confirm from outside that the fix works.