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 to the site only over HTTPS and not allow fallback to HTTP. :contentReference[oaicite:0]{index=0}
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. :contentReference[oaicite:1]{index=1}
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?
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 automatically upgraded to HTTPS. MDN and Chromium documentation both describe HSTS this way. :contentReference[oaicite:2]{index=2}
That has one major consequence: if HTTPS on that site is broken, the browser will often refuse to continue. MDN explicitly says that 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. Mozilla support also explains that when Firefox sees HSTS for a host, it suppresses the normal “add exception” flow. :contentReference[oaicite:3]{index=3}
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, but the common factor is this: the browser already knows the site must be HTTPS-only, so it refuses to downgrade or ignore broken TLS. :contentReference[oaicite:4]{index=4}
Why HSTS Errors Happen
Most real cases come from a short list of causes.
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 site certificate is expired, issued for the wrong hostname, or otherwise invalid, browsers that know the site is HSTS-only will refuse the connection. MDN states that HSTS prevents bypassing invalid certificate errors on future connections. :contentReference[oaicite:5]{index=5}
This often happens after:
- certificate expiration,
- switching from one hostname to another,
- moving from
wwwto non-www, - 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. Mozilla support pages about secure connection problems and error codes repeatedly point to incomplete certificate chains as a cause of trust failures. If the chain is incomplete and the browser cannot build trust correctly, HSTS will block the connection instead of allowing a user exception. :contentReference[oaicite:6]{index=6}
3. Antivirus or HTTPS Inspection Is Replacing the Certificate
Mozilla support explains that 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, proxies, or security software inserting their own certificates. If Firefox or another browser does not trust that inserted issuer properly, the HSTS-protected site fails hard. :contentReference[oaicite:7]{index=7}
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. Chrome’s Lighthouse guidance describes HSTS as a way to force browsers to use TLS and not fall back to plaintext HTTP. That only works safely if HTTPS is already correct. If a site turns on HSTS before SSL, redirects, certificates, and hostname handling are fully stable, the result can be a lockout instead of stronger security. :contentReference[oaicite:8]{index=8}
5. The Browser Learned HSTS Earlier and Is Remembering It
Browsers can learn HSTS in two main ways: by visiting a site that sent the HSTS header, or through a preload list built into the browser. Chromium documentation states that HSTS works with both client state and a preload list, and Mozilla support forum answers note that Firefox can learn HSTS from an internal list or from previous site visits. That is why a browser may still force HTTPS even after a server-side change seems to remove it. :contentReference[oaicite:9]{index=9}
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. If a site forces HTTPS through HSTS, then also has broken redirect rules, HTTPS-only logic can expose redirect loops or route users into a bad TLS endpoint. MDN notes that HSTS upgrades future HTTP attempts to HTTPS automatically, so any broken HTTPS destination becomes much more obvious and harder to work around. :contentReference[oaicite:10]{index=10}
How to Fix HSTS Error Step by Step
Start by figuring out whether the issue is on your device or on the website itself. That one distinction saves a lot of wasted work.
1. Check Whether One Site Fails or Many Secure Sites Fail
This is the best first test.
- 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.
Mozilla’s secure connection troubleshooting article uses this same distinction because local interception and site misconfiguration lead to very different fixes. :contentReference[oaicite:11]{index=11}
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 often overlooked. It matters most when the browser complains about security or certificate validity on otherwise trusted sites. Mozilla’s secure connection help pages include local system conditions among the reasons certificate validation can fail. :contentReference[oaicite:12]{index=12}
3. Clear Cookies and Cached Site Data
Cookies are not the main cause of HSTS itself, but clearing site data can help 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,
- fixing redirect rules,
- changing certificate setup recently.
4. Disable Antivirus HTTPS Scanning or Web Protection Temporarily
Mozilla explicitly states that secure connection problems can happen when something on the computer or network is replacing the secure connection. Temporarily disabling HTTPS scanning or similar features is one of the best ways to prove whether local interception is the real cause. :contentReference[oaicite:13]{index=13}
If the site works after that, the website may be fine and your local security layer is the problem.
5. Check Proxy and VPN Settings
If a proxy or VPN sits between the browser and the site, it can change the secure path or insert its own certificate behavior. This matters most if:
- the site works on another network,
- only one managed device is affected,
- the issuer shown by the browser looks unfamiliar,
- corporate filtering tools are in use.
Mozilla support specifically notes that network or local tools can replace secure connections, which is directly relevant here. :contentReference[oaicite:14]{index=14}
6. If You Own the Site, Check the Certificate First
If this is your website, verify:
- the certificate is not expired,
- the certificate matches the exact hostname,
- the full certificate chain is installed,
- the site is actually serving the correct certificate 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. MDN states this directly. :contentReference[oaicite:15]{index=15}
7. Install the Full Certificate Chain
If the server is not sending the intermediate certificate, fix that before doing anything else. Mozilla support discussions and certificate error guidance repeatedly treat incomplete chains as a core reason for trust failures. On an HSTS-enabled site, that mistake becomes much more visible because the browser will not let users click through. :contentReference[oaicite:16]{index=16}
8. Check Redirect Rules Alongside SSL
Test the site with:
http://example.comhttps://example.comwww.example.comexample.com
HSTS will upgrade future HTTP attempts to HTTPS automatically, so if the HTTPS destination is wrong or part of a redirect loop, the browser will keep landing on the broken secure version. MDN and Chromium documentation both explain that HSTS upgrades future attempts to HTTPS. :contentReference[oaicite:17]{index=17}
9. Check Whether the Site Is Preloaded or Previously Cached as HSTS
Chromium’s HSTS documentation explains that HSTS can be remembered through client state and preload lists. Mozilla support forum guidance also notes that Firefox can know a site is HSTS either because it saw the header before or because the browser includes it internally. This matters because removing the header on the server does not instantly make the browser forget it. :contentReference[oaicite:18]{index=18}
This is why 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, browser state may be damaged. At that point, a browser refresh or clean profile test can help. But 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 to be the real issue. :contentReference[oaicite:19]{index=19}
11. Review Recent Changes First
This is often the shortest route to the root cause.
Ask what changed before the HSTS error started:
- SSL renewal,
- server migration,
- hostname change,
- Cloudflare or proxy change,
- new antivirus or endpoint security,
- redirect rule changes,
- 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. MDN describes HSTS as instructing browsers to use HTTPS only and refuse bypasses for certain certificate errors. That is why the real fix is almost always certificate, chain, issuer, or redirect correction. :contentReference[oaicite:20]{index=20}
Use the Browser Warning Details
If the warning page includes more detail, inspect:
- certificate issuer,
- hostname mismatch,
- certificate expiration,
- whether an exception can be added or not.
Mozilla support forum guidance makes it clear that the “no add exception” behavior itself is a clue that HSTS is active for the host. :contentReference[oaicite:21]{index=21}
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. Chrome’s HSTS guidance and MDN both present HSTS as a security mechanism that prevents downgrade to plaintext HTTP. Removing it without fixing the real secure configuration can weaken the site without actually solving the operational problem. :contentReference[oaicite:22]{index=22}
Preload Makes Mistakes More Expensive
Chromium documentation states that HSTS works with a preload list as well as browser-learned state. That means 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 extremely careful. :contentReference[oaicite:23]{index=23}
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.
The best prevention is simple: treat HSTS as a final security layer, not as the first step of an unfinished HTTPS migration.
When to Contact Support
Contact your hosting provider or certificate provider if:
- the error affects one public website only,
- the certificate may be invalid or incomplete,
- the site recently migrated or changed SSL settings,
- you need help serving the full chain correctly.
Contact your IT or security admin if:
- many secure sites fail on one managed computer,
- HTTPS inspection or enterprise proxies may be involved,
- 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,
- the issue appears only on one device or one network.
FAQ
What is an HSTS error?
An HSTS error 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, on future connections, not allow bypassing certain certificate errors. :contentReference[oaicite:24]{index=24}
Why can’t I add an exception to the certificate warning?
Because when HSTS is active for a host, browsers such as Firefox suppress the normal exception path. Mozilla support explicitly notes that sites using HSTS do not allow certificate exceptions in the usual way. :contentReference[oaicite:25]{index=25}
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. :contentReference[oaicite:26]{index=26}
Can antivirus software cause an HSTS error?
Yes. Mozilla support says 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. :contentReference[oaicite:27]{index=27}
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. HSTS should remain only after HTTPS is fully correct. :contentReference[oaicite:28]{index=28}
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. :contentReference[oaicite:29]{index=29}
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 much faster than trying to bypass the warning.