What is hsts
Last updated: April 1, 2026
Key Facts
- HSTS is implemented through an HTTP response header that tells browsers to enforce secure HTTPS connections for specified durations
- Browsers remember HSTS requirements and automatically upgrade HTTP requests to HTTPS for affected domains, preventing user override
- The HSTS header specifies a max-age duration during which the browser enforces the policy, typically ranging from months to years
- HSTS preload lists maintained by browsers allow websites to be included for automatic HTTPS enforcement even on first visit
- HSTS requires a valid SSL/TLS certificate and full HTTPS implementation; websites cannot use HSTS with self-signed certificates
Overview
HTTP Strict Transport Security (HSTS) is a web security mechanism that forces browsers to establish secure, encrypted connections with websites using HTTPS. Implemented through an HTTP response header, HSTS eliminates the opportunity for attackers to intercept communications by downgrading connections to unencrypted HTTP. This security measure protects against man-in-the-middle attacks, session hijacking, and other attacks that exploit unencrypted connections.
How HSTS Works
When a website sends the HSTS header in its HTTP response, the browser caches this instruction for the specified duration. During this period, the browser automatically converts any HTTP requests to that domain into HTTPS requests before sending them to the server. This occurs at the browser level, before any data travels across the network, preventing attackers from intercepting or downgrading the connection. Different domains and subdomains can have separate HSTS policies.
HSTS Header Structure
The HSTS header follows the format: Strict-Transport-Security: max-age=[seconds]; includeSubDomains; preload. The max-age parameter specifies how long the browser enforces the policy in seconds. The includeSubDomains directive extends the policy to all subdomains. The preload directive indicates the site's inclusion in browser preload lists, enabling HSTS enforcement even on initial visits before receiving the header.
Benefits and Implementation
HSTS provides critical protection against protocol downgrade attacks where attackers force users from HTTPS to HTTP. It eliminates user behavior risks, such as typing http:// instead of https:// in the address bar. For sensitive websites handling authentication, financial transactions, or personal data, HSTS is essential security infrastructure. Implementation requires a valid SSL/TLS certificate and careful configuration to avoid locking users out of sites with certificate issues.
HSTS Preload and Best Practices
Websites can submit their domain to HSTS preload lists maintained by Chromium, Firefox, and other browsers. Inclusion ensures HSTS enforcement from the first visit, providing maximum security. Best practices include starting with conservative max-age values before increasing duration, testing thoroughly before implementation, and maintaining valid SSL/TLS certificates. Removal from preload lists requires formal requests and can take considerable time.
Related Questions
What is the difference between HSTS and HTTPS?
HTTPS encrypts data during transmission, while HSTS enforces the use of HTTPS. HTTPS is the underlying protocol; HSTS is a mechanism ensuring browsers always use it, preventing downgrade attacks.
Can I remove a website from the HSTS preload list?
Yes, websites can request removal from HSTS preload lists through official removal portals. However, removal takes time as the updated list must propagate to all browsers, potentially taking months.
What happens if my SSL certificate expires with HSTS enabled?
Users will receive certificate error warnings and cannot bypass them like they could without HSTS. This makes maintaining valid certificates critical. Prepare certificate renewals well in advance to prevent service disruptions.
More What Is in Daily Life
- What Is a Credit ScoreA credit score is a three-digit number, typically ranging from 300 to 850, that represents your cred…
- What Is CD rates make no sense based on length of time invested. Explain like I'm 5CD (Certificate of Deposit) rates often don't increase with longer lock-up times the way people expe…
- What is a phdA PhD (Doctor of Philosophy) is a doctoral degree earned after completing advanced academic research…
- What is a polymathA polymath is a person with deep knowledge and expertise across multiple different fields or academi…
- What is aaveAAVE stands for African American Vernacular English, a dialect with distinct grammar, pronunciation,…
- What is aarch64ARMv8-A (commonly called ARM64 or AArch64) is a 64-bit processor architecture developed by ARM Holdi…
- What is about menTopics and discussions about men typically encompass masculinity, male identity, gender roles, men's…
- What is abiturAbitur is the German academic qualification awarded upon completion of secondary education, typicall…
- What is abrosexualAbrosexual is a sexual orientation identity where a person's sexual attraction changes or fluctuates…
- What is abgABG is an Indonesian acronym standing for 'Anak Baru Gede,' which refers to adolescent girls or teen…
- What is aaaAAA batteries are a standard cylindrical battery size measuring 10.5mm in diameter and 44.5mm in len…
- What is aacAAC (Advanced Audio Codec) is a digital audio compression format that provides better sound quality …
- What is aaa gameAAA games are high-budget video games developed by large studios with budgets typically exceeding $1…
- What is a proxyA proxy is a server that acts as an intermediary between your device and the internet, forwarding yo…
- What is ableismAbleism is discrimination and prejudice against people with disabilities based on the assumption tha…
- What is absAbs, short for abdominal muscles, are the muscles in your core that flex your spine and stabilize yo…
- What is abortionAbortion is a medical procedure that ends pregnancy by removing the fetus before viability. It can b…
- What is accutaneAccutane (isotretinoin) is a powerful prescription medication derived from vitamin A used to treat s…
- What is acetaminophenAcetaminophen, also known as paracetamol, is an over-the-counter pain reliever and fever reducer use…
- What is acidAcid is a chemical substance that donates protons (hydrogen ions) to other substances, characterized…
Also in Daily Life
- How To Save Money
- Why are so many white supremacist and right wings grifters not white
- Does "I'm 20 out" mean youre 20 minutes away from where you left, or youre 20 minutes away from your destination
- Why are so many men convinced that they are ugly
- What does awol mean
- What does asl mean
- What does ad mean
- What does asap mean
- What does apex mean
- What does asmr stand for
- What does atp mean
- What causes autism
- What does abg mean
- What does am and pm mean
- What does a fox sound like
More "What Is" Questions
Trending on WhatAnswer
Browse by Topic
Browse by Question Type
Sources
- MDN - HTTP Strict Transport Security CC-BY-SA-2.5
- RFC 6797 - HTTP Strict Transport Security Public Domain