liveBook · Manning

HTTP Strict Transport Security

Also called HSTS

The Strict-Transport-Security header is an HTTP response header that instructs a browser to access a site only over HTTPS for a specified period.

How 5 Manning books explain it

ASP.NET Core in Action, 3e

HTTP Strict Transport Security is a web security policy that lets a site instruct browsers to use HTTPS for subsequent requests.

How it is used
Protects browser traffic by making HTTPS the required protocol for subsequent application requests.
How deep it goes
Explains browser behavior, deployment boundaries, middleware configuration, and preload options without detailing header parsing internals.
Examples
Uses ASP.NET Core HstsMiddleware with production gating, max-age configuration, preload, subdomains, and excluded hosts.
What you can do after
Configure ASP.NET Core HstsMiddleware for production and choose appropriate max-age, preload, and subdomain settings.

Read how ASP.NET Core in Action, 3e explains HTTP Strict Transport Security →

Building Web APIs with ASP.NET Core

An HTTP security policy that instructs browsers to access a site only over HTTPS.

How it is used
Adds an HTTPS-only browser policy to the web API’s security-header setup.
How deep it goes
Defines HSTS and shows middleware configuration, but does not detail policy parameters.
Examples
Shows app.UseHsts() in Program.cs’s non-development security-header pipeline.
What you can do after
Apply HSTS through ASP.NET Core’s UseHsts middleware in the non-development pipeline.

Read how Building Web APIs with ASP.NET Core explains HTTP Strict Transport Security →

Real-World Cryptography

HSTS is an HTTP security policy mechanism that instructs a browser to access a website only over HTTPS for a specified period.

How it is used
Uses an HTTPS response header to move browser visits from HTTP toward HTTPS.
How deep it goes
Explains subsequent HTTPS enforcement and the unprotected first connection, but does not detail header directives or browser storage.
Examples
Uses an HTTP-to-HTTPS redirect and an attacker removing that redirect during the first connection.
What you can do after
Understand how HSTS reduces redirect-stripping risk after a browser has received the policy.

Read how Real-World Cryptography explains HTTP Strict Transport Security →

Grokking Web Application Security

HTTP Strict Transport Security is an HTTP security standard that instructs browsers to access a website only over HTTPS for a specified period.

How it is used
Enforces browser use of HTTPS as a practical defense against SSL-stripping and man-in-the-middle attacks.
How deep it goes
Explains browser policy and max-age, then stops short of broader HSTS options while showing an integrated NGINX configuration.
Examples
Uses one-week and one-year max-age headers plus an NGINX server configuration with an HTTP redirect and TLS 1.3.
What you can do after
Configure HSTS alongside HTTPS certificates, HTTP redirects, and secure server settings.

Read how Grokking Web Application Security explains HTTP Strict Transport Security →

.NET in Action, Second Edition

HTTP Strict Transport Security is a web security policy that tells browsers to access a site only through HTTPS.

How it is used
Protects production HTTPS deployments when HTTP requests are redirected or terminated by a proxy.
How deep it goes
Explains browser caching, threat reduction, environment selection, and ASP.NET Core activation, while deferring detailed header semantics.
Examples
Uses app.UseHsts() and AddHsts options for production activation and policy configuration.
What you can do after
Operate/configure ASP.NET Core services to emit HSTS only in suitable production environments.

Read how .NET in Action, Second Edition explains HTTP Strict Transport Security →

Also covered in

What to know first

Related concepts

Questions about HTTP Strict Transport Security

What is HTTP Strict Transport Security?

The Strict-Transport-Security header is an HTTP response header that instructs a browser to access a site only over HTTPS for a specified period.

Which Manning books explain HTTP Strict Transport Security?

ASP.NET Core in Action, 3e, Building Web APIs with ASP.NET Core, Real-World Cryptography, Grokking Web Application Security and .NET in Action, Second Edition.

What should I know before learning HTTP Strict Transport Security?

Manning books that teach HTTP Strict Transport Security usually introduce domain name system, HTTP, HTTPS and SSL first.

What is the difference between HTTP Strict Transport Security and upgrade-insecure-requests directive?

The Strict-Transport-Security header is an HTTP response header that instructs a browser to access a site only over HTTPS for a specified period. The Upgrade-Insecure-Requests directive is a Content-Security-Policy directive that tells a browser to upgrade insecure resource requests to HTTPS.

What kinds of HTTP Strict Transport Security are there?

Kinds of HTTP Strict Transport Security include preload directive.

What is HTTP Strict Transport Security a kind of?

HTTP Strict Transport Security is a kind of security header. A security header is an HTTP response header that instructs a client, typically a browser, to apply a security-related protection or restriction.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.