HTTPS is HTTP carried inside TLS. The padlock promises three things: nobody on the network can read the traffic, nobody can change it unnoticed, and you are talking to the server that owns the domain name.
What a certificate does
A server presents a certificate that binds its domain name to a public key, signed by a certificate authority that browsers trust. During the handshake the client checks the signature, the name, the expiry date and the chain, then both sides agree on temporary keys for the session. Modern TLS 1.3 does this in one round trip.
What HTTPS does not promise
It does not mean the site is honest, only that you reached the domain you typed. It does not protect the server from attacks such as SQL injection, and it does not hide which domain you visit from the network.
Redirect, then HSTS
Many users type a plain http:// address. A redirect to HTTPS helps, but that first request travels unprotected, so an attacker in the middle can interfere. HTTP Strict Transport Security (HSTS) fixes this: the server tells the browser, over HTTPS, to use only HTTPS for this domain for a period.
Strict-Transport-Security: max-age=31536000; includeSubDomainsAfter one visit, the browser upgrades every request itself, even if the user types http://. Start with a short max-age while testing, because a mistake locks you in for the whole period.
A short checklist
- Serve every page and asset over HTTPS, so there is no mixed content.
- Keep TLS 1.2 as the minimum and prefer 1.3.
- Automate certificate renewal, for example with the ACME protocol used by Let's Encrypt, and monitor expiry.
- Mark cookies
Secure. - Send HSTS once everything works over HTTPS.
# Inspect what a server presents (certificate subject, issuer and expiry).
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -subject -issuer -datesTakeaway
HTTPS gives confidentiality, integrity and server identity. Automate certificates, redirect HTTP, and add HSTS so browsers never downgrade.
Comments