Sub topic 15
Troubleshooting Common Let's Encrypt Failures
This chapter assumes you can use a Linux shell and sudo, edit nginx configuration, inspect DNS records, and manage systemd services. It also assumes that nginx is already installed and that your domain should point to this server.
Let's Encrypt validation usually fails because the public Internet cannot reach the expected challenge response. Renewal can also fail because nginx cannot load the new certificate or the renewal task is not running.
A practical troubleshooting path
Start by identifying which stage failed:
HTTP-01 validation failures
The HTTP-01 challenge requires Let's Encrypt to retrieve a file from:
http://your-domain/.well-known/acme-challenge/<token>
Check that the domain resolves to the correct public address:
dig +short example.com
dig +short www.example.comThe returned address must belong to this server. Check IPv6 as well. An incorrect AAAA record can cause validation to reach a different host even when the A record is correct.
Port 80 must be reachable from the Internet. A local firewall, cloud security group, router, or provider firewall can block it:
sudo ss -ltnp | grep -E ':(80|443)\b'
sudo ufw status
curl -I http://example.com/.well-known/acme-challenge/testThe curl command may return 404, which is acceptable for this test if the request clearly reaches the correct nginx server. A timeout or connection refusal indicates a network or listener problem.
Do not redirect challenge requests to an application that cannot serve them. Check nginx server blocks and confirm that the requested domain appears in server_name.
DNS-01 and wildcard failures
Wildcard certificates require DNS-01. Certbot asks you to publish a TXT record at a name such as _acme-challenge.example.com.
Check the record from a public resolver:
dig TXT _acme-challenge.example.comWait for the correct TXT value to become visible before continuing. DNS providers may take time to publish records, and multiple old TXT values can remain during repeated attempts. Do not remove a value that another active validation still needs.
Nginx and certificate errors
Always test nginx before reloading it:
sudo nginx -t
sudo systemctl status nginx --no-pager
sudo journalctl -u nginx -n 50 --no-pagerCommon causes include a misspelled certificate path, a missing semicolon, or a certificate file that nginx cannot read. Certbot normally maintains these paths:
/etc/letsencrypt/live/example.com/fullchain.pem
/etc/letsencrypt/live/example.com/privkey.pemUse fullchain.pem, not only the leaf certificate. The full chain allows clients to build a trust path to a trusted certificate authority.
| Symptom | Likely cause | First check |
|---|---|---|
| Timeout during validation | Firewall, security group, or wrong DNS | `dig`, port 80 access |
| Connection refused | No service listening | `ss -ltnp` |
| `nginx -t` fails | Configuration or path error | `nginx -t` output |
| Renewal succeeds but old certificate is served | Nginx was not reloaded | Deploy hook and `systemctl reload nginx` |
| Too many requests | Production rate limit | Use staging while testing |
>callout note > A successful certbot renew does not prove that clients receive the new certificate. The web server must reload the renewed files.
Renewal and rate-limit checks
Confirm that a scheduled task exists and run a safe simulation:
systemctl list-timers | grep -i certbot
sudo certbot renew --dry-runUse staging when correcting repeated validation problems. Production attempts can trigger rate limits, while staging certificates are not trusted by normal browsers.
Check the system clock if certificates appear invalid:
timedatectl statusA badly incorrect clock can make a valid certificate appear not yet valid or expired.
Verify the certificate clients receive
Test the live endpoint with SNI, which tells the server which hostname you want:
echo | openssl s_client -connect example.com:443 \
-servername example.com 2>/dev/null \
| openssl x509 -noout -subject -issuer -datesConfirm the subject or SAN includes the requested hostname, the issuer is expected, and the dates are current.
Exercise
DNS resolves correctly, but Certbot reports a timeout for HTTP-01 validation. What should you check first?
Show answer
Check that port 80 is reachable through the server firewall, cloud security group, and provider firewall, and confirm that nginx is listening on port 80.