HeaderDial › Guides

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.

SituationChrome 159Firefox 158
Header removed by HeaderDial before the first HTTPS visitnothing stored; http:// stays http://nothing stored; stays http://
Policy already stored, then header removed and the HTTPS page visited againstill switched to https://still switched to https://
Policy already stored, then header set to max-age=0 and the HTTPS page visited againpolicy cleared; stays http://still switched; the page still read max-age=3600
Header added with max-age=600 to an HTTPS response that had nonestored; http:// switched afterwardsstored; switched afterwards
Header added to a plain-HTTP responseignoredignored
Header added with includeSubDomainsa subdomain was switched tooa 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

  1. Click the HeaderDial icon. If the site-access banner appears, choose Allow on all sites or Only <current host>.
  2. Click + Response header, type Strict-Transport-Security (it is in the suggestions) and choose remove.
  3. Open Where it applies, click + Only on…, choose Domain and enter the test host, for example staging.example.com.
  4. If the browser already stored a policy for that host, clear it as described below. The rule does not do that for you.
  5. Open the http:// URL. If it stays on http://, 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

  1. Open chrome://net-internals/#hsts.
  2. 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.
  3. Under Delete domain security policies, enter the host and click Delete. In our test the next http:// visit stayed on http://.

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:

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

Never remove or shorten HSTS on a production site you care about by changing the browser. It only changes your browser, and visitors still get the server's policy. Test policy changes on a staging host with a short max-age.

Add to ChromeFirefox: coming soon