curl / Docs / Protocols / HSTS

HSTS support

HTTP Strict-Transport-Security. Added as experimental in curl 7.74.0. Supported "for real" since 7.77.0.

Standard

HTTP Strict Transport Security

Behavior

libcurl features an in-memory cache for HSTS hosts, so that subsequent HTTP-only requests to a hostname present in the cache gets internally "redirected" to the HTTPS version.

curl_easy_setopt() options:

curl command line options

HSTS cache file format

Lines starting with # are ignored.

For each hsts entry:

[host name] "YYYYMMDD HH:MM:SS"

The [host name] is dot-prefixed if it includes subdomains.

The time stamp is when the entry expires.

Possible future additions