HTTPS and TLS

What TLS actually protects, how certificates get validated, renewal automation, and mixed content traps.

What HTTPS gives you

PropertyMeaning
ConfidentialityNobody on the network can read the traffic
IntegrityTampering is detected, not silently accepted
AuthenticationYou are talking to the real server, not an impostor

Note what it does not do: HTTPS does not make a site trustworthy, and it encrypts only the transport β€” the server still sees everything once decrypted.

Certificate chains

A browser trusts a certificate because it chains to a root already in its trust store. You normally install a leaf certificate plus any intermediate certificates β€” a missing intermediate is the most common 'works in some browsers' failure.

openssl s_client -connect example.com:443 -servername example.com

echo | openssl s_client -connect example.com:443 2>/dev/null \
  | openssl x509 -noout -dates -subject -issuer

Renewal without drama

# Let's Encrypt with Certbot
certbot certonly --webroot -w /var/www/app -d example.com -d www.example.com
certbot renew --dry-run

# certificates typically last 90 days; automate renewal
systemctl list-timers | grep certbot
πŸ’‘
Short-lived certificates (90 days or less) are the modern norm. Automate renewal and set expiry monitoring β€” certificate expiry is still a leading cause of avoidable outages.

Mixed content

Loading any subresource over http:// in an https:// page weakens the guarantee. Modern browsers silently upgrade images but block scripts and styles β€” showing 'unexpected behaviour' rather than an obvious error.

<!-- do not hardcode the scheme -->
<script src='//cdn.example/lib.js'></script>

<!-- better: same-origin, scheme-relative as fallback -->
<script src='/vendor/lib.js'></script>

Add Content-Security-Policy: upgrade-insecure-requests to rewrite accidental http URLs automatically, and always send HSTS once you are confident.

FAQ

Do I need HTTPS for a static site?
Yes. It is free, it is expected, HTTP/2 and several browser APIs require it, and search engines treat HTTPS as standard.
Certificate says 'not secure' but it is valid?
Usually a hostname mismatch (wrong domain in the cert) or a missing intermediate chain β€” check with the openssl commands above.

HTTP headers Hash functions: MD5, SHA-1, SHA-256

Last refreshed 2026-09-17.