Pcornel
Browse topics
Options
Recent
Favorites
Security · Technical reference

HSTS · Web Security

Direct answer

HSTS (HTTP Strict Transport Security) tells browsers to always use HTTPS for a domain for a set time, such as max-age=31536000; includeSubDomains, preventing SSL stripping attacks.

When to use this

Use this when forcing browsers to use HTTPS.

First 30 seconds

1. HSTS forces HTTPS after first visit.

2. max-age ≥ 1 year.

3. includeSubDomains once all subdomains have HTTPS.

4. Preload carefully.

5. Only send over HTTPS.

Operational verification

HTTPS response → HSTS → future requests HTTPS only

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • Setting preload before every subdomain supports HTTPS — removal from the preload list takes months.
  • Sending HSTS over HTTP (ignored by browsers).
  • Very short max-age that gives little protection; aim for at least one year (max-age=31536000).
  • Forgetting that HSTS does not protect the very first visit unless the domain is preloaded.
Platform / version applicability
Security architecture and operations
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformSecurity architecture and operations
Key commandcurl -sI https://example.com | grep -i strict-transport
Scope / prerequisiteUse this when forcing browsers to use HTTPS.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Checks Verify boundary
curl -sI https://example.com | grep -i strict-transport

Check preload status at hstspreload.org. Requirements for preload: valid certificate, redirect HTTP → HTTPS on the same host, all subdomains on HTTPS, header with max-age ≥ 31536000, includeSubDomains and preload.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Use max-age of at least a year.
  • Add includeSubDomains when all subdomains use HTTPS.
  • Preload is hard to undo.
Key checks
  • curl -sI https://<site> | grep -i strict-transport-security — header
  • max-age, includeSubDomains, preload — values
  • HTTP → HTTPS redirect — first visit
ReferenceWhy it matters1 section · depth on demand

Rolling it out

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

Start with a short max-age (for example 300) and increase it. includeSubDomains requires every subdomain to support HTTPS. Preloading (hstspreload.org) protects the very first visit but is hard to undo, so add it last.

ReferenceImportant terms & boundaries1 section · depth on demand

In depth

HTTP Strict Transport Security (HSTS) tells browsers to use only HTTPS for a site for a set period, even if a user types http:// or follows an HTTP link. It closes the window where the first request could be intercepted and downgraded.

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

Documented example, not captured output.

Rollout: start with a short max-age (e.g. 300 seconds), confirm all subdomains work over HTTPS, increase to a year, then consider includeSubDomains and preload list submission. Preloading is hard to undo — browsers ship the list — so only preload when every current and future subdomain will support HTTPS.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docSecurity architecture and operations current

Authoritative/upstream documentation reviewed for bounded claims in Web Security → HSTS. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://owasp.org/www-project-application-security-verification-standard/ · confidence 94%
Confirmation

Confirm action

Continue?