HSTS check: does your website force https?

We read your website's https response: does it set the Strict-Transport-Security header, with which max-age, and does http redirect to https? Plus the certificate and TLS version.

Free, no sign-up no credit card public data only Deutsch

What the HSTS check tests

  • Expiry date. Expired is red, under 21 days yellow.
  • Trust. Is the certificate issued for exactly this name, by an authority browsers trust, with the full chain?
  • http to https. Does http:// redirect to https://?
  • HSTS. Does the https response set Strict-Transport-Security?
  • TLS version. TLS 1.2 or 1.3, and does the server still accept TLS 1.0 or 1.1?

The same check reads your domain's SPF, DKIM and DMARC. More on that: SPF, DKIM and DMARC check. Security headers and outdated libraries: Security headers check. Single topics: SSL checker, TLS version check, HSTS check.

Questions

What is HSTS?

HTTP Strict Transport Security: a header that tells the browser to load your site over https only, for a set time. Even someone who types http:// or follows an old link then goes straight to https.

Which value is right?

Strict-Transport-Security: max-age=31536000 (one year) is common. To try it out, start with a short value such as max-age=300, then raise it. Add includeSubDomains only if every subdomain works over https.

Why does the header only count over https?

Browsers only honour Strict-Transport-Security in an https response (RFC 6797). Set over http it has no effect. That is why the redirect from http to https comes first; the check tests it too.

How do I set HSTS?

nginx: add_header Strict-Transport-Security "max-age=31536000" always; Apache or .htaccess: Header always set Strict-Transport-Security "max-age=31536000". On Cloudflare under SSL/TLS > Edge Certificates > HTTP Strict Transport Security. In WordPress often through the security or SSL plugin you already use.

What is HSTS preload?

A list built into browsers: domains on it load over https only, even on the very first visit. It requires a max-age of at least one year, includeSubDomains and preload in the header. Removal takes months, so be sure first.

What else does the check test?

Expiry, trust and chain of the certificate, the TLS version and the redirect from http to https. Your domain's SPF, DKIM and DMARC are checked as well.