Documentation
SSL / TLS Setup
Issuing a certificate for your domain, keeping it renewed, and making sure the site is actually served over HTTPS rather than merely capable of it.
Certificates, ACME validation, and HTTPS enforcement work the same way regardless of who runs the server. What differs per account is which of these steps is automated for you and which you perform yourself. Where that matters, it is marked as a placeholder — confirm it during onboarding rather than assuming either way.
What a certificate actually proves
A TLS certificate binds a public key to one or more domain names, signed by a certificate authority (CA) that the client already trusts. It proves that whoever holds the matching private key controls those names. It does not say anything about the organisation behind the site, and for the domain-validated certificates almost everyone uses, it is not intended to.
Three pieces must all line up:
- The private key, generated on the server and never transmitted anywhere. If a private key is ever emailed, pasted into a chat, or committed to a repository, treat the certificate as compromised and reissue.
- The leaf certificate, which lists the names it is valid for, in the Subject Alternative Name (SAN) field. The legacy Common Name field is ignored by modern clients.
- The intermediate chain, linking the leaf to a root the client trusts. Serving the leaf without its intermediates is the classic "works in my browser, fails everywhere else" bug — browsers often paper over it, other clients do not.
ACME and the three validation methods
ACME is the protocol that automates issuance. A client proves control of a domain,
the CA issues a certificate, and the whole exchange repeats automatically before
expiry. Let's Encrypt is the best-known ACME CA; ZeroSSL and others implement the
same protocol, and common clients include certbot, acme.sh,
and lego, with the same functionality built into Caddy and Traefik.
| Challenge | How it proves control | Use when |
|---|---|---|
HTTP-01 |
The CA fetches a token from http://your-domain/.well-known/acme-challenge/… on port 80. |
The default for a single hostname on a publicly reachable web server. Requires port 80 open and the DNS record already correct. |
DNS-01 |
The CA checks a TXT record at _acme-challenge.your-domain. |
Required for wildcard certificates. Also the option when the host is not publicly reachable, or when port 80 is closed. Needs API access to your DNS provider to be automatic. |
TLS-ALPN-01 |
The CA opens a TLS connection on port 443 using a special ALPN protocol. | Port 443 is available but port 80 is not. Less widely supported by clients and panels. |
Note what all three have in common: they depend on DNS already resolving correctly. Certificate issuance is the step after DNS & Domains, never before.
Wildcards and multi-name certificates
A wildcard such as *.example.com covers one label only — it matches
app.example.com but not a.b.example.com, and not the bare
example.com. If you need both the apex and its subdomains, the
certificate must list both. Wildcards require DNS-01; there is no way
to obtain one via HTTP-01.
Unless you specifically need a wildcard, a certificate naming each host explicitly is easier to reason about and limits the blast radius if a key is ever exposed.
Issuing a certificate
-
Confirm DNS first. Every name that will appear on the certificate
must already resolve to the host that will serve it.
dig +short example.com www.example.com -
Make the validation path reachable. For
HTTP-01, port 80 must be open and requests to/.well-known/acme-challenge/must reach the ACME client — not be swallowed by a catch-all redirect, an authentication wall, or a single-page-app rewrite rule. A redirect from HTTP to HTTPS is fine as long as the challenge path is excluded or the redirect target still serves it. - Request the certificate for every name it should cover, in one certificate rather than several. On this platform, issuance is automatic / requested through the control panel / run by you on the server — confirm during onboarding.
- Install the full chain, not the leaf alone, and reload the web server so it picks up the new files.
- Confirm automatic renewal is in place before you consider the task done. See Renewal.
Public ACME CAs enforce per-domain issuance limits over a rolling window, and failed attempts count against a separate failure limit. If you are experimenting or debugging, use the CA's staging environment — Let's Encrypt provides one, and its certificates are untrusted by design but issued under far looser limits. Repeatedly retrying against production is the reliable way to lock yourself out for a week.
Renewal
Publicly trusted certificates have short lifetimes — Let's Encrypt issues for 90 days, and the industry maximum for new certificates has been falling steadily. Short lifetimes are only workable if renewal is automatic, so treat automation as part of the setup rather than a later improvement.
- Renew early. ACME clients conventionally attempt renewal at about one third of the lifetime remaining — roughly day 60 of 90 — which leaves a month of failed attempts before anything breaks.
- Reload the server after renewal. A renewed file on disk changes nothing until the process re-reads it. Most clients support a deploy or post-renewal hook for exactly this.
- Confirm the timer or cron job exists and is enabled, rather than assuming the installer set it up.
- Monitor expiry independently of the renewal mechanism. The failure mode you care about is renewal silently not running, and a system that only checks itself will not tell you.
Checking the renewal timer on a systemd-based server:
systemctl list-timers | grep -i -E "certbot|acme|renew"
systemctl status certbot.timer
A dry run exercises the whole path without consuming rate limits:
sudo certbot renew --dry-run
Enforcing HTTPS
Having a certificate is not the same as using it. Four things make HTTPS actually enforced:
-
Redirect HTTP to HTTPS with a permanent redirect
(
301or308), preserving the path and query string. Keep port 80 listening — closing it does not improve security and breaksHTTP-01renewal. -
Fix mixed content. A page loaded over HTTPS that pulls scripts,
stylesheets, or images over HTTP will have them blocked or flagged. Use protocol-relative
paths sparingly and absolute
https://URLs by preference; browser developer tools list every offending request in the console. -
Mark cookies correctly —
Secureso they are never sent over plain HTTP,HttpOnlyfor anything a script does not need to read, and an appropriateSameSitevalue. - Consider HSTS, once everything above is stable.
HSTS, carefully
Strict-Transport-Security tells browsers to refuse plain HTTP for your
domain for a stated period. It is genuinely useful and it is also the one header
here you cannot quickly take back — a browser that has cached a long
max-age will keep enforcing it even after you remove the header.
# Start short while you confirm nothing breaks
Strict-Transport-Security: max-age=300
# Then, once stable, a production value
Strict-Transport-Security: max-age=31536000; includeSubDomains
Only add includeSubDomains once you are certain every subdomain,
including internal ones, can serve HTTPS. The preload directive commits
the domain to a list baked into browser releases; removal takes months, so treat it
as a decision rather than a setting.
CAA records
A CAA record in your DNS zone states which certificate authorities are
permitted to issue for the domain. Compliant CAs check it before issuing, so it
narrows who can obtain a certificate for your name even if some other validation
path were abused.
example.com. IN CAA 0 issue "letsencrypt.org"
example.com. IN CAA 0 issuewild ";"
The first line permits issuance by Let's Encrypt only; the second forbids wildcard
issuance entirely. Set these to match the CA you actually use — if you add a
CAA record naming a CA you do not use, your own renewals will start
failing.
dig +short CAA example.com
Verifying your configuration
# Certificate names, issuer, and validity window
openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null \
| openssl x509 -noout -subject -issuer -dates -ext subjectAltName
# Is the chain complete? "Verify return code: 0 (ok)" is what you want
openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null \
| grep -E "Verify return code|Certificate chain" -A2
# Does HTTP redirect to HTTPS, and is HSTS present?
curl -sSI http://example.com | grep -i -E "^HTTP|^location"
curl -sSI https://example.com | grep -i -E "^HTTP|strict-transport-security"
The -servername flag sends SNI. Without it you may be shown the server's
default certificate rather than the one for your domain, which produces a very
confusing name-mismatch error.
Troubleshooting
| Symptom | Usual cause |
|---|---|
| Browser warns the certificate is for a different site | The name is not in the SAN list — commonly the certificate covers www but the visitor reached the apex, or vice versa. Reissue covering both. |
Works in a browser, fails from curl, an app, or a CI runner |
Incomplete chain. Browsers can fetch or guess missing intermediates; other clients will not. Serve the full chain file. |
| Certificate has expired | Renewal ran but the server was never reloaded, or the timer was never enabled. Check both, then reload. |
HTTP-01 validation fails |
Port 80 blocked, DNS still pointing at the old host, or the application intercepting /.well-known/. Test by placing a plain text file at that path and fetching it over HTTP. |
DNS-01 validation fails |
The TXT record has not propagated yet, or a stale record from a previous attempt is still present. Query _acme-challenge against the authoritative nameserver directly. |
| Every certificate looks invalid on one machine | System clock skew, or an out-of-date CA trust store. Check the date before suspecting the certificate. |
| Issuance suddenly refused | CA rate limit reached, or a CAA record forbidding that CA. Both appear in the ACME client's error output verbatim — read it rather than retrying. |