xref: /curl/docs/cmdline-opts/hsts.md (revision e7219c2b)
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Long: hsts
5Arg: <filename>
6Protocols: HTTPS
7Help: Enable HSTS with this cache file
8Added: 7.74.0
9Category: http
10Multi: append
11See-also:
12  - proto
13Example:
14  - --hsts cache.txt $URL
15---
16
17# `--hsts`
18
19Enable HSTS for the transfer. If the filename points to an existing HSTS cache
20file, that is used. After a completed transfer, the cache is saved to the
21filename again if it has been modified.
22
23If curl is told to use HTTP:// for a transfer involving a hostname that exists
24in the HSTS cache, it upgrades the transfer to use HTTPS. Each HSTS cache
25entry has an individual life time after which the upgrade is no longer
26performed.
27
28Specify a "" filename (zero length) to avoid loading/saving and make curl just
29handle HSTS in memory.
30
31If this option is used several times, curl loads contents from all the
32files but the last one is used for saving.
33