How to remove or change Strict-Transport-Security (HSTS) while testing, and clear a cached policy
To stop a test server's Strict-Transport-Security header from reaching the browser, add a response header row for it in HeaderDial with the operation remove, limited to that host. That prevents the browser from storing a new HSTS policy. It does not undo a policy the browser stored on an earlier visit. In Chrome 159 and Firefox 158, a host that had sent HSTS once kept being switched from http:// to https:// after we removed the header. To clear a stored policy, delete the domain on chrome://net-internals/#hsts in Chrome or Edge, or remove the site's data in Firefox. In Chrome only, a rule that sets the header to max-age=0 also clears it on the next HTTPS visit.
How HSTS works
A server sends Strict-Transport-Security: max-age=31536000 on an HTTPS response. The browser stores that policy for the host, for max-age seconds, and from then on rewrites every http:// URL for that host to https:// before sending anything. With includeSubDomains the policy covers every subdomain too. The rules are in RFC 6797.
That is why HSTS gets in the way while testing: a staging host that sent the header once, maybe from a shared proxy configuration, can no longer be opened over plain HTTP. And because the upgrade happens inside the browser, the plain-HTTP request never reaches the server, so server logs show nothing.
What we measured
We checked this with HeaderDial 0.3.0 in Chrome 159.0.8154.6 and Firefox 158.0.1 in November 2026. A local test server answered plain HTTP and HTTPS on the same port for a test host name, with a certificate both browsers trusted. One URL sent Strict-Transport-Security: max-age=3600. After each step we opened the http:// URL and noted whether the browser switched it to https://. In Chrome we also queried chrome://net-internals/#hsts. Edge uses Chrome's engine, but we did not test it separately.
| Situation | Chrome 159 | Firefox 158 |
|---|---|---|
| Header removed by HeaderDial before the first HTTPS visit | nothing stored; http:// stays http:// | nothing stored; stays http:// |
| Policy already stored, then header removed and the HTTPS page visited again | still switched to https:// | still switched to https:// |
Policy already stored, then header set to max-age=0 and the HTTPS page visited again | policy cleared; stays http:// | still switched; the page still read max-age=3600 |
Header added with max-age=600 to an HTTPS response that had none | stored; http:// switched afterwards | stored; switched afterwards |
| Header added to a plain-HTTP response | ignored | ignored |
Header added with includeSubDomains | a subdomain was switched too | a subdomain was switched too |
So HeaderDial's response rules do reach the browser's HSTS logic in both browsers: removing the header and adding one both worked. The difference is set on a header the server already sends. Chrome applied the new value. Firefox 158 kept the server's value, both for HSTS and for what a fetch() on the page reported. In our tests, Content-Type was the only other response header where Firefox did this.
Steps: stop a test server's HSTS reaching the browser
- Click the HeaderDial icon. If the site-access banner appears, choose Allow on all sites or Only <current host>.
- Click + Response header, type
Strict-Transport-Security(it is in the suggestions) and choose remove. - Open Where it applies, click + Only on…, choose Domain and enter the test host, for example
staging.example.com. - If the browser already stored a policy for that host, clear it as described below. The rule does not do that for you.
- Open the
http://URL. If it stays onhttp://, nothing is stored.
To try out a policy before deploying it, set the header instead: for example max-age=300, short enough to expire on its own. Use a test host, because a policy you add this way stays stored after you switch the rule off.
Clear a stored policy in Chrome or Edge
- Open
chrome://net-internals/#hsts. - Under Query HSTS domain, enter the host and click Query. "Not found" means there is no policy; otherwise the output lists the policy, including
dynamic_sts_expiry. - Under Delete domain security policies, enter the host and click Delete. In our test the next
http://visit stayed onhttp://.
The page itself says that preloaded entries cannot be deleted. Hosts on the HSTS preload list are built into the browser and always use HTTPS.
Alternatively, while the policy is stored, set the header to max-age=0 with HeaderDial and load any HTTPS page on the host once. In Chrome that removed the stored policy. It did not work in Firefox.
Clear a stored policy in Firefox
Either of these cleared it in our test. We called the functions behind the two commands directly instead of clicking through the dialogs, after reading Firefox 158's own code to check that these are the functions the commands use:
- Settings › Privacy & Security › Cookies and Site Data › Manage browsing data, select the site, Remove Selected, then Save Changes. This also deletes the site's cookies, so you will be logged out.
- In the History sidebar or the Library window, right-click a page from the site and choose Forget About This Site….
The curl equivalent
curl does not store HSTS policies unless you ask it to, so it shows what the server sends:
curl -sI https://staging.example.com/ | grep -i '^strict-transport-security'
# curl can keep its own HSTS cache if you want to test that
curl --hsts hsts.txt -sI https://staging.example.com/
Pitfalls
max-age.- Removing the header is not enough. A policy stored before you added the rule stays until it expires or you clear it.
- includeSubDomains on a parent domain. A policy from
example.comwithincludeSubDomainscoversstaging.example.comtoo. Query and delete the parent domain as well. - Plain HTTP is ignored. The header only counts on HTTPS responses; adding it to an
http://response did nothing in either browser. - Switch it off afterwards. Give the row an expiry such as 1 hour, or press Alt+Shift+D to pause every profile.
Add to ChromeFirefox: coming soon