Skip to main content
Guides/Website Security

HSTS Check: Understand and Use the Results

Check HSTS policy and preload status

EdgeDNS Team·Updated ·6 min read

HSTS: telling browsers to never accept the unencrypted version of your site

HSTS stands for HTTP Strict Transport Security. It is a small HTTP response header — `Strict-Transport-Security: max-age=31536000; includeSubDomains; preload` — that tells the browser, "from now on, never connect to this domain over plain HTTP. Always force HTTPS, no exceptions, even if the user typed `http://` or clicked an old `http://` link." The browser remembers the instruction for the duration specified by the `max-age` directive (typically one or two years), and if a request to the HTTP version of the site ever comes up during that time, the browser silently rewrites it to HTTPS before it goes out on the wire.

You should care because **without HSTS, your visitors are still vulnerable to a class of attack called the first-visit hijack or *SSL stripping***. If a user types `bank.example.com` into their browser without specifying `https://`, the browser starts by sending an HTTP request — and an attacker on the same network (an open Wi-Fi hotspot, a compromised router, a state-level adversary on a national ISP) can intercept that initial plaintext request and never let it upgrade to HTTPS. The user thinks they're on a normal site; they are actually being silently man-in-the-middled. HSTS closes this window by making the browser remember, after the very first HTTPS visit, to never speak HTTP to that domain again.

The five things every HSTS check looks at:

  • Is the HSTS header present? The bare minimum.

  • Is `max-age` long enough? Modern best practice is at least one year (31536000 seconds), and two years for sites that want to be on the preload list.

  • Is `includeSubDomains` set? Without it, only the apex domain is protected — every subdomain is still hijackable.

  • Is `preload` set, and is the domain on the [HSTS preload list](https://hstspreload.org/)? Preloading bakes the HSTS rule into the browser itself, so even the very first visit is protected.

  • Are there any HTTP-only subdomains that would break under `includeSubDomains`? This is the main reason teams hesitate — turning on `includeSubDomains` and discovering that an internal subdomain wasn't HTTPS-ready.

Three questions an HSTS check answers:

  • Are my visitors protected against SSL-stripping attacks during their first visit?

  • Is my entire domain — including all subdomains — covered, or just the root?

  • Should I be on the HSTS preload list, and what would it take to qualify?

The cost of skipping HSTS is the small but persistent risk of session hijacking on insecure networks. The fix is one HTTP header. For sites that handle payments, logins, or any sensitive data, HSTS is no longer optional; it is the baseline. The protocol is defined in RFC 6797.

The HSTS Check endpoint, in plain language

Check HSTS (HTTP Strict Transport Security) policy and preload status

HSTS (HTTP Strict Transport Security) (RFC (Request for Comments) 6797) protects against SSL (Secure Sockets Layer) stripping and protocol downgrade attacks by ensuring browsers only connect via HTTPS (secure HyperText Transfer Protocol). Without HSTS, an attacker on the same network can intercept the initial HTTP (HyperText Transfer Protocol) request and redirect to a malicious site. Preload list inclusion provides protection from the very first visit — critical for high-security applications. HSTS is required by PCI DSS 4.0.1 and recommended by OWASP and NIST SP 800-52r2 (Guidelines for TLS (Transport Layer Security) Implementations).

What is actually happening when you call it

Runs four parallel checks: (1) parses the apex HTTPS (secure HyperText Transfer Protocol) Strict-Transport-Security header (max-age, includeSubDomains, preload); (2) calls hstspreload.org /API/v2/status for current listing; (3) calls /API/v2/preloadable for the canonical pre-submission errors/warnings; (4) probes port 80 to verify HTTP (HyperText Transfer Protocol)→HTTPS redirect AND that the redirect response carries an HSTS (HTTP Strict Transport Security) header (preload requires it). Flags edge cases: `max-age=0` while `preload` is set (active removal), `max-age > 2y` (above Chromium cap).

Why this specific tool matters

Choose a task: HTTPS Migration Verification. After migrating to HTTPS (secure HyperText Transfer Protocol), verify HSTS (HTTP Strict Transport Security) is properly configured to prevent downgrade attacks.

Run the HSTS Check request below and retain the input and observed result. Before changing configuration, compare the relevant fields with the value or policy you expected. Use the HSTS Check reference to check the field definitions and supported options.

Info:

Available on the free plan. The technical details: `GET /v1/domain/hsts`.

When would I actually use this?

HTTPS Migration Verification

After migrating to HTTPS (secure HyperText Transfer Protocol), verify HSTS (HTTP Strict Transport Security) is properly configured to prevent downgrade attacks.

Use the finding: Ensure HTTPS (secure HyperText Transfer Protocol) is enforced and users can't be redirected to HTTP (HyperText Transfer Protocol).

Preload List Submission Prep

Before submitting to HSTS (HTTP Strict Transport Security) preload list, verify all requirements are met (max-age, includeSubDomains, preload).

Use the finding: Avoid preload submission rejection by validating configuration first.

Security Assessment

Evaluate HSTS (HTTP Strict Transport Security) configuration as part of web application security assessment.

Use the finding: Document HTTPS (secure HyperText Transfer Protocol) enforcement controls for security audits.

The easiest way: just ask your AI assistant

Connect the MCP server. Just ask in plain English:

Use domain_hsts with domain=https://google.com. Show the returned findings, identify unavailable evidence, and explain a useful next check.

Confirm the tool and inputs in the client before accepting its summary. For HSTS Check, use the response fields below to separate observations from recommendations.

Tip:

The dedicated MCP server is available on every plan. Individual tool access and request limits depend on your plan. Management categories and endpoints disabled for the tool catalog are not exposed through MCP.

The technical way: call it from code

This HSTS Check request uses the example inputs from its API contract. Replace YOUR_API_KEY with a key on the free plan or higher; adapt the target to your task.

bash
curl --request GET 'https://api.edgedns.dev/v1/domain/hsts?domain=https%3A%2F%2Fgoogle.com' \
  --header "Authorization: Bearer YOUR_API_KEY"

Prepare inputs for HSTS Check

Start with the inputs below. Keep the same hostname, path, and options when comparing HSTS Check observations. The API reference contains the complete parameter contract, optional settings, and access requirements.

FieldTypeRequired?What it meansExample

domain

string

Yes

Domain or full URL (web address) — accepts `example.com` or `HTTPS://example.com/path`. The HSTS (HTTP Strict Transport Security) / preload probe always tests HTTPS→HTTPS-direct and HTTP→HTTPS redirect, regardless of the protocol picked.

https://google.com

Interpret HSTS Check findings

Read these fields alongside the full response from your HSTS Check check. A missing value or failed lookup is different from a passing result. Keep returned errors and confidence or cache metadata when available; do not replace missing evidence with a successful default. See the complete response reference for additional fields.

FieldTypeWhat you'll see in it

domain

string

The queried domain (bare hostname).

url

string

Full URL (web address) that was fetched, echoing the protocol used in the request.

hasHsts

boolean

Whether HSTS (HTTP Strict Transport Security) header is present

Words you might be wondering about

API (Application Programming Interface) — A way for one program to ask another program for something — like a waiter taking your order to the kitchen.

HTTP (HyperText Transfer Protocol) — The language web browsers and websites use to talk to each other.

HTTPS (secure HyperText Transfer Protocol) — HTTP with encryption — the little padlock in your browser. It means nobody between you and the website can read what you're sending.

SSL (Secure Sockets Layer) — The original encryption used by HTTPS. The name stuck even though every modern site actually uses TLS, the newer replacement.

TLS (Transport Layer Security) — The encryption that puts the 'S' in HTTPS. It scrambles data so nobody between you and a website can read it.

HSTS (HTTP Strict Transport Security) — A header that tells browsers "always use HTTPS for this site, never plain HTTP, even if the user types it." Prevents downgrade attacks.

RFC (Request for Comments) — The official internet standards documents. When someone says 'RFC 8484' they mean a specific numbered standards document — in that case, the one defining DNS over HTTPS.

Need Programmatic Access?

Automate domain intelligence with 100+ API endpoints and a free MCP server for AI integration.

HSTS Check: Results Guide | EdgeDNS