The web HSTS 2 min read
What is HSTS?
Your browser opened a site securely yesterday. Today you follow an old HTTP link to the same host. Can the browser upgrade it before making the request?
-
Learn the policy over HTTPS
The site sends a
Strict-Transport-Securityresponse header over HTTPS. Itsmax-agetells the browser how long to remember that the host should be reached using HTTPS.In short The browser learns HSTS from a secure connection.
-
Upgrade the next visit before sending it
While that policy is active, the browser rewrites an HTTP URL for that host to HTTPS before making a network request. The connection still has to pass normal HTTPS certificate checks.
In short A remembered policy upgrades the URL before the network request.
Where this applies
A first visit can happen before the browser has learned the policy. Preloading can address that first-visit gap for eligible hosts.
Keep this
HSTS tells the browser to use HTTPS on future visits.
Distinguish a browser upgrade before the request from a server redirect after one.