Skip to content

Gift shoppingAn unfamiliar online shop? Check it for free before you pay.Check a shop

HSTS check

What is HSTS, what max-age should it have and when should you not turn it on?

Short answer

HSTS is the Strict-Transport-Security header, with which a website tells the browser: next time, connect to this domain only over HTTPS, even if someone slips you a link with http. Tegmia reads whether the header is in the response and how long it is valid for: if it is missing, we report a finding with medium severity; if max-age is below 180 days, we report a finding with low severity, because the browser does not remember the rule long enough.

Part of the check Headers and HTTPS configuration.

What it is

Without HSTS a gap remains even on a website that redirects correctly: the first attempt to connect goes over HTTP, and only the answer sends it to HTTPS. That one request can be intercepted and rewritten.

HSTS closes that gap, but it works going forward: the browser remembers the rule for the duration of max-age. The recommended value is 31536000 seconds, which is one year.

The includeSubDomains directive extends the rule to every subdomain. That is the part you can break the most with — if a subdomain cannot do HTTPS, it becomes unreachable once this is on, and you cannot take it back straight away.

The preload list in browsers is stronger still and even harder to undo. Do not add yourself to it before HSTS with a one-year max-age has run without problems.

How Tegmia measures it

What the check actually does, with the thresholds at which it reports a finding.

  1. We read the Strict-Transport-Security header from the response to the home page over HTTPS.
  2. When the header is missing, we report http.hsts_missing with medium severity.
  3. When it is there, we read its max-age value. Below 15,552,000 seconds (180 days) we report http.hsts_short_max_age with low severity and write into the finding both the measured value and the recommended 31,536,000.
  4. We store the whole header value, so includeSubDomains and preload are visible in the evidence too.

What this does not measure

  • We do not check whether the domain is on the browsers’ preload list.
  • We do not report a missing includeSubDomains as a finding. For some domains that is the right configuration, and a finding would be a false accusation.
  • We do not check that every subdomain really can do HTTPS — one response cannot tell us that.

The findings this can lead to

Straight from the catalogue. You will see the same text in the report.

The HSTS header is missing

Medium

http.hsts_missing · Headers and HTTPS configuration

Without HSTS, the browser may connect insecurely on the first attempt, even when a redirect exists. HSTS closes this gap.

What to do: Add the header Strict-Transport-Security: max-age=31536000; includeSubDomains. First check that all subdomains support HTTPS.

Default severity medium: Plan it within a month. On its own it is not enough for an attack, but it makes one easier. The full rule in the catalogue

HSTS has a very short lifetime

Low

http.hsts_short_max_age · Headers and HTTPS configuration

A short max-age value weakens the protection, because the browser does not remember the rule for long enough.

What to do: Raise max-age to 31536000 (one year) once HTTPS is stable.

Default severity low: Fine-tuning. No immediate risk; fixing it improves the overall picture. The full rule in the catalogue

A typical misconfiguration

A short max-age left over from testing. During the roll-out the value is rightly set to a few minutes so you can back out. Then nobody remembers to raise it, and the protection is about the same as if the header were not there.

The opposite mistake is too bold a start: includeSubDomains and preload straight away with a one-year max-age, while some subdomain — an internal tool, an old test site — still runs on HTTP. That subdomain then disappears, and getting it back takes weeks.

How to fix it

Specific steps, in the order in which they make sense.

  1. 01First check that the redirect from HTTP to HTTPS works on every variant of the domain.
  2. 02List the subdomains and find out for each whether it can do HTTPS. The decision on includeSubDomains is made from this list, not from a guess.
  3. 03Turn the header on with a short validity, for example max-age=300, and check that nothing broke.
  4. 04Raise it to max-age=31536000 and, depending on the result of the previous step, add includeSubDomains.
  5. 05The preload list comes last, and only when you are sure that no subdomain will ever need to run on HTTP.

What it looks like

The values as you will write or see them.

Recommended value

Strict-Transport-Security: max-age=31536000; includeSubDomains

Value for trying it out

Strict-Transport-Security: max-age=300

A short validity is right only during the roll-out.

Check it on your own domain

We read only what the domain has published.

The scan reads the domain’s public records and configuration and shows the result of this check for you, including the evidence we based it on.

Situations this answers

Related checks

What goes with it and is usually done together.

  • HTTP to HTTPS redirect check

    How we measure that a website does not stay on an unencrypted connection, and why the www variant is so often forgotten.

  • Security headers check

    The headers we read from your website's response, what each of them solves and in what order to introduce them.

  • SSL certificate check

    What one TLS connection reveals about a certificate: the issuer, the domain names, the key strength and the protocol version.

Last updated 22 October 2026. We write this page by hand and correct it when what we measure changes. Found a mistake? Tell us via the contact page.