🛡️
blog.cat.ssl

What to know before enabling HSTS: benefits and risks

21.11.2026
← All articles

HSTS (HTTP Strict Transport Security) is a single response header, but its effect is powerful. Once a browser receives it, it opens the site over HTTPS only for the specified period: even if the user types http:// or follows an old link, the browser upgrades the request before anything reaches the server. That is safer than a plain 301 redirect because it removes even the first unencrypted request. The same power makes careless HSTS risky, because fixing a mistake on the server does not immediately change what browsers have already remembered.

What HSTS gives you

With a normal redirect, the first request still travels over plain HTTP, and on untrusted networks such as public Wi-Fi an attacker can intercept it. HSTS closes that window. It also removes the "proceed anyway" option on certificate errors, so users cannot click past a warning.

Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

Risk one: a memory you cannot revoke quickly

Browsers keep the rule until max-age expires. If you set a year and later SSL breaks, for example a failed renewal or a temporary move to a server without SSL, every returning visitor is locked out with no HTTP fallback and no bypass button. Removing the header does not help right away; the browser only clears the rule when it receives max-age=0 over a working HTTPS connection.

Risk two: includeSubDomains and forgotten subdomains

Domains accumulate names over the years: an old test site, an internal reporting tool, an office device's web panel, a service that only speaks HTTP. With includeSubDomains, all of them must work over HTTPS. A college in Bukhara added a one-year HSTS header with includeSubDomains to misol.uz after reading online advice. The next day teachers could not open the electronic register at jurnal.misol.uz, which ran on an old internal server without SSL. Removing the header was not enough because browsers had already cached the rule; installing SSL on the register server fixed it. A short max-age during testing would have made the problem expire on its own within minutes.

Risk three: the preload list

A preloaded domain is hardcoded into browsers and opens over HTTPS even for first-time visitors. Inclusion typically requires a long max-age, includeSubDomains and HTTPS on every subdomain, and removal takes a long time to reach users through browser updates. Check the official preload service page for current requirements. Most small business sites do not need preload.

A safe rollout

  1. Confirm the main site and www are stable on HTTPS with automatic certificate renewal.
  2. List every subdomain and check each one over HTTPS.
  3. Start without includeSubDomains and with max-age=300.
  4. Increase gradually to a day, a week, then a year.
  5. Add includeSubDomains only when all subdomains are ready.
# Nginx, inside the HTTPS server block
add_header Strict-Transport-Security "max-age=300" always;

# Apache with mod_headers
Header always set Strict-Transport-Security "max-age=300"

Verify with curl -sI https://example.uz | grep -i strict-transport. While testing, you can clear the rule in your own Chrome at chrome://net-internals/#hsts; this affects only your browser. On sayt.uz hosting, Let's Encrypt certificates renew automatically, which is a solid base for HSTS, but review all your subdomains and their DNS records in the sayt.uz cabinet first.

Related articles

📧 SSL for mail.domain.uz: Fixing the Outlook Certificate Warning ⏳ Let's Encrypt Rate Limits: Fixing "too many certificates" 📜 Certificate Transparency: How Public Logs of SSL Certificates Work 🏢 SSL for internal (intranet) sites: how to secure office systems
🌐 Language
🇺🇿 O⁠'zbek 🇺🇿 Özbek (yangi) 🇺🇿 Ўзбек 🇷🇺 Русский 🇬🇧 English ✓