HSTS Error: How to Fix It Fast

Browser blocking a site because of an HSTS and certificate error
An HSTS error means the browser must use HTTPS, but the secure connection or certificate is broken

HSTS error usually appears when a browser is forced to use HTTPS for a website, but the site’s certificate or secure connection is broken. HSTS stands for HTTP Strict Transport Security, a policy that tells browsers to connect only over HTTPS and not allow a fallback to HTTP.

This is why HSTS errors feel stricter than normal certificate warnings. Once a browser knows a site must use HTTPS, it will not let the user bypass many certificate problems. MDN states that HSTS tells the browser to use HTTPS only, and that future secure connection errors, such as an invalid certificate, cannot be bypassed. Mozilla support also notes that when a site uses HSTS, Firefox may not allow adding an exception for the certificate.

Quick Fix

  • Check whether the site fails only in one browser or on all browsers.
  • Confirm the device date, time, and timezone are correct.
  • Clear cookies and cached site data for the affected domain.
  • Disable antivirus HTTPS scanning or proxy filtering temporarily.
  • If you own the site, make sure the SSL certificate is valid and not expired.
  • Install the full certificate chain, including intermediate certificates.
  • Check that the certificate matches the exact hostname.
  • Verify that HTTPS is configured correctly before enabling HSTS.
  • If the domain is preloaded or previously cached as HSTS, fix the certificate first rather than trying to bypass the warning.
  • Review redirect rules if HTTP, HTTPS, and proxy logic may be conflicting.

What Is an HSTS Error?

HTTPS padlock and strict transport security policy
HSTS forces browsers to stay on HTTPS and blocks the usual certificate exception path

An HSTS error is not one single browser code. It is a secure connection failure that becomes stricter because the site has an HSTS policy. The Strict-Transport-Security header tells browsers that the host should only be accessed via HTTPS, and future HTTP attempts should be upgraded to HTTPS automatically.

That has one major consequence: if HTTPS on that site is broken, the browser will often refuse to continue. On future connections, the browser will not allow users to bypass certain secure connection errors, such as an invalid certificate, once HSTS is in effect. When Firefox sees HSTS for a host, it suppresses the normal “add exception” flow.

You may see messages like these:

This site uses HTTP Strict Transport Security (HSTS) to specify that the browser may only connect to it securely.
As a result, it is not possible to add an exception for this certificate.

Or:

Your connection is not secure
The owner of example.com has configured their website improperly.

The visible page may mention HSTS, certificate trust, hostname mismatch, or a secure connection failure. The common factor is that the browser already knows the site must be HTTPS-only, so it refuses to downgrade or ignore broken TLS.

Why HSTS Errors Happen

1. The SSL Certificate Is Invalid, Expired, or Mismatched

This is one of the most common causes. HSTS itself is not the underlying bug. It only makes certificate problems harder to ignore. If the certificate is expired, issued for the wrong hostname, or otherwise invalid, browsers that know the site is HSTS-only will refuse the connection.

This often happens after certificate expiration, switching hostnames, moving from www to non-www, or migrating hosting without reinstalling SSL correctly.

2. The Server Is Missing the Intermediate Certificate

A site can have a valid main certificate and still fail if the server does not send the full certificate chain. Incomplete chains cause trust failures. On an HSTS site the browser will block the connection instead of allowing a user exception.

Checking an SSL certificate chain on a secure website
A missing intermediate certificate is a common reason HSTS blocks an otherwise valid site

3. Antivirus or HTTPS Inspection Is Replacing the Certificate

Secure connection errors can happen because something on the computer or network is blocking or replacing the secure connection. In practice this often means antivirus HTTPS scanning, enterprise inspection tools, or proxies inserting their own certificates. If the browser does not trust that inserted issuer, the HSTS-protected site fails hard.

4. The Site Uses HSTS but HTTPS Was Never Fully Finished

This is a common configuration mistake. HSTS is meant for sites that already have stable HTTPS. It forces browsers to use TLS and not fall back to plaintext HTTP. That only works safely if HTTPS is already correct. Turning on HSTS before SSL, redirects, certificates, and hostname handling are stable can lock users out.

5. The Browser Learned HSTS Earlier and Is Remembering It

Browsers learn HSTS by visiting a site that sent the header, or through a preload list built into the browser. That is why a browser may still force HTTPS even after a server-side change seems to remove the header. Removing the header does not make every browser forget it instantly.

6. HTTP, HTTPS, and Redirect Rules Are Fighting Each Other

Sometimes the visible issue looks like a certificate problem, but the real cause is mixed redirect logic. HSTS upgrades future HTTP attempts to HTTPS automatically, so any broken HTTPS destination becomes much more obvious and harder to work around.

How to Fix HSTS Error Step by Step

1. Check Whether One Site Fails or Many Secure Sites Fail

  • If only one site fails, that site’s certificate, hostname, or chain is the stronger suspect.
  • If many secure sites fail, your browser, antivirus, proxy, or local trust environment is more likely the problem.

2. Check the Device Date and Time

A wrong system clock can make valid certificates appear invalid. This is one of the fastest checks and is often overlooked. Confirm the date, time, and timezone, then reload the site.

3. Clear Cookies and Cached Site Data

Cookies are not the main cause of HSTS itself, but clearing site data helps if the site also has broken redirects, old login state, or stale cached behavior after HTTPS changes. This is especially useful after moving to HTTPS, changing the canonical host, or fixing redirects.

Correct device time and timezone for SSL and HSTS validation
A wrong system clock can make a valid certificate look invalid under HSTS

4. Disable Antivirus HTTPS Scanning or Web Protection Temporarily

Temporarily disabling HTTPS scanning is one of the best ways to prove whether local interception is the real cause. If the site works after that, the website may be fine and the local security layer is the problem.

5. Check Proxy and VPN Settings

A proxy or VPN can change the secure path or insert its own certificate. This matters most if the site works on another network, only one managed device is affected, the issuer looks unfamiliar, or corporate filtering tools are in use.

6. If You Own the Site, Check the Certificate First

Verify that the certificate is not expired, matches the exact hostname, includes the full chain, and is the certificate actually served on the live domain. Because HSTS blocks bypassing invalid certificates, even a small SSL mistake becomes a hard failure for returning users and preload-listed browsers.

7. Install the Full Certificate Chain

If the server is not sending the intermediate certificate, fix that before anything else. On an HSTS-enabled site that mistake is more visible because the browser will not let users click through.

8. Check Redirect Rules Alongside SSL

Test http://example.com, https://example.com, www.example.com, and example.com. HSTS upgrades future HTTP attempts to HTTPS, so if the HTTPS destination is wrong or part of a redirect loop, the browser keeps landing on the broken secure version.

9. Check Whether the Site Is Preloaded or Previously Cached as HSTS

HSTS can be remembered through client state and preload lists. Removing the header on the server does not instantly make the browser forget it. The real fix is to repair HTTPS correctly, not to hope the browser will fall back to HTTP.

10. Refresh the Browser Profile Only if the Problem Is Broad

If many secure sites fail in one browser only, and antivirus or proxy checks did not solve it, a clean browser profile can help. Do not do this first if only one public website is affected. In one-site cases the server certificate and chain are much more likely the issue.

11. Review Recent Changes First

Ask what changed before the error started: SSL renewal, server migration, hostname change, Cloudflare or proxy change, new antivirus, redirect rule changes, or turning on HSTS too early. Most HSTS-related failures begin right after one of those changes.

Advanced Troubleshooting

Understand That HSTS Is Not the Bug

HSTS usually is not the underlying problem. It is the policy that makes a deeper HTTPS problem impossible to ignore. The real fix is almost always certificate, chain, issuer, or redirect correction.

Use the Browser Warning Details

If the warning page includes more detail, inspect the certificate issuer, hostname mismatch, expiration, and whether an exception can be added. The “no add exception” behavior itself is a clue that HSTS is active for the host.

Do Not “Fix” a Public Site by Disabling HTTPS

If a public site is meant to use HSTS, the correct solution is to repair HTTPS. Removing HSTS without fixing the real secure configuration weakens the site without solving the operational problem.

Preload Makes Mistakes More Expensive

HSTS works with a preload list as well as browser-learned state. Mistakes on preloaded domains are especially painful because users cannot simply switch back to HTTP while you repair things. If a domain is or may be preloaded, certificate and redirect hygiene must be careful.

Prevention Tips

  • Only enable HSTS after HTTPS is fully stable.
  • Install the full certificate chain, not just the main certificate.
  • Test every hostname variant before and after SSL changes.
  • Review antivirus and proxy HTTPS interception on admin machines.
  • Be careful before preloading a domain for HSTS.
  • Document your redirect and certificate deployment process.
  • Monitor certificate expiration before it becomes urgent.

Treat HSTS as a final security layer, not as the first step of an unfinished HTTPS migration.

When to Contact Support

Contact your host or certificate provider if the error affects one public website only, the certificate may be invalid or incomplete, the site recently migrated, or you need help serving the full chain.

Contact IT if many secure sites fail on one managed computer, HTTPS inspection or enterprise proxies may be involved, or the browser is receiving unexpected certificate issuers.

Focus on local troubleshooting if other users can open the site, another browser works, turning off antivirus scanning changes the result, or the issue appears only on one device or one network.

FAQ

What is an HSTS error?

It is a secure connection failure that becomes strict because the browser knows the site must use HTTPS only. HSTS tells browsers to always use HTTPS and not allow bypassing certain certificate errors.

Why can’t I add an exception to the certificate warning?

When HSTS is active for a host, browsers such as Firefox suppress the normal exception path. Sites using HSTS do not allow certificate exceptions in the usual way.

Can HSTS itself break a website?

HSTS usually does not create the root problem by itself. It exposes and enforces a broken HTTPS setup by preventing fallback to HTTP and blocking invalid certificate bypasses.

Can antivirus software cause an HSTS error?

Yes. Secure connection problems can happen when something on your computer or network blocks or replaces the secure connection. Antivirus HTTPS scanning is a common example.

How do I fix HSTS error on my website?

Fix the real HTTPS problem: install a valid certificate, serve the full intermediate chain, match the correct hostname, and make sure redirects and proxy logic send users to a working HTTPS endpoint. Keep HSTS only after HTTPS is fully correct.

Final Thoughts

HSTS error usually means the browser already knows the site must be HTTPS-only, but the site’s secure setup is not trustworthy enough to complete the connection. The browser is doing exactly what HSTS was designed to make it do: refuse broken HTTPS instead of falling back to weaker behavior.

Start with the real split first: one site or many. Then check certificates, full chain, hostname match, redirect logic, and local HTTPS interception in that order. That path solves most HSTS-related failures faster than trying to bypass the warning.

Related SSL Errors

Leave a Comment