Safeguard
Security Guides•

Does HSTS stop users from clicking through certificate warnings?

Yes, for hosts where the browser holds an HSTS policy. It forces HTTPS and blocks the bypass button. What it does not do, and how to roll it out safely.

Safeguard Security Team
4 min read

Yes, for sites where the browser has an HSTS policy. OWASP says HSTS tells the browser to always request the site over HTTPS and prevents users from bypassing certificate warnings. It does not fix a bad certificate. It makes sure a bad one stops the visit instead of being clicked past.

What HSTS is

HTTP Strict Transport Security is a response header. The server sends it over HTTPS, and the browser remembers it for a set time. During that time the browser upgrades plain HTTP requests to HTTPS itself and treats certificate problems as hard failures.

Without it, a user who meets a certificate warning on a hostile network can usually press a button to proceed. That is the moment an attacker in the middle is waiting for.

What it protects and what it does not

ThreatHSTS helps?
First request typed as http:// on a hostile networkAfter the first visit, yes
User clicks through a certificate warningYes, the bypass is blocked
Expired or misissued certificate on your serverNo, the visit just fails
Weak TLS version or ciphersNo, configure TLS separately
A user's very first visit everNot unless the host is preloaded

Preloading is a separate step with its own rules, so read the current browser preload documentation before relying on it.

How to roll it out safely

  1. Make sure every page and subdomain you will cover works over HTTPS.
  2. Fix certificate names. OWASP says the certificate name must match the fully qualified name of the server.
  3. Start with a short lifetime so a mistake can be undone.
  4. Watch error rates and support tickets for a week.
  5. Raise the lifetime in steps.
  6. Only then consider including subdomains, after you have listed every one.
  7. Automate certificate renewal. A hard failure plus an expired certificate is an outage with no workaround.

Why the last step matters

HSTS removes the escape hatch on purpose. If your certificate expires, users cannot click through. That is the right security outcome and a painful operational one, so renewal monitoring is part of the rollout, not an extra.

Pair it with a sound TLS setup

OWASP says web applications must default to TLS 1.3, and that TLS 1.0, 1.1, SSLv2 and SSLv3 must be disabled. Certificates should be signed by a trusted CA, use SHA-256 rather than MD5 or SHA-1, and use RSA keys of at least 2048 bits. See which TLS versions your app should support for the version policy.

Try it yourself

Open the web app scan demo and look at how response headers and transport settings are reported. Check whether your own site would show the HSTS header.

Click through it at your own pace, or open it full screen.

Safeguard can generate an SBOM and scan your dependencies, so outdated cryptography libraries with known advisories show up in one inventory, and policies can gate a build on them. A free scan is at gold.safeguard.sh/scan.

Quick check

Can HSTS break a site?

Yes, if a covered host cannot serve valid HTTPS, browsers will refuse it. Test and monitor before extending the lifetime.

Do APIs need HSTS?

It targets browsers. For non browser clients, make sure they validate certificates and use HTTPS only.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.