xref: /aosp_15_r20/external/curl/docs/cmdline-opts/hsts.md (revision 6236dae45794135f37c4eb022389c904c8b0090d)
1*6236dae4SAndroid Build Coastguard Worker---
2*6236dae4SAndroid Build Coastguard Workerc: Copyright (C) Daniel Stenberg, <[email protected]>, et al.
3*6236dae4SAndroid Build Coastguard WorkerSPDX-License-Identifier: curl
4*6236dae4SAndroid Build Coastguard WorkerLong: hsts
5*6236dae4SAndroid Build Coastguard WorkerArg: <filename>
6*6236dae4SAndroid Build Coastguard WorkerProtocols: HTTPS
7*6236dae4SAndroid Build Coastguard WorkerHelp: Enable HSTS with this cache file
8*6236dae4SAndroid Build Coastguard WorkerAdded: 7.74.0
9*6236dae4SAndroid Build Coastguard WorkerCategory: http
10*6236dae4SAndroid Build Coastguard WorkerMulti: append
11*6236dae4SAndroid Build Coastguard WorkerSee-also:
12*6236dae4SAndroid Build Coastguard Worker  - proto
13*6236dae4SAndroid Build Coastguard WorkerExample:
14*6236dae4SAndroid Build Coastguard Worker  - --hsts cache.txt $URL
15*6236dae4SAndroid Build Coastguard Worker---
16*6236dae4SAndroid Build Coastguard Worker
17*6236dae4SAndroid Build Coastguard Worker# `--hsts`
18*6236dae4SAndroid Build Coastguard Worker
19*6236dae4SAndroid Build Coastguard WorkerEnable HSTS for the transfer. If the filename points to an existing HSTS cache
20*6236dae4SAndroid Build Coastguard Workerfile, that is used. After a completed transfer, the cache is saved to the
21*6236dae4SAndroid Build Coastguard Workerfilename again if it has been modified.
22*6236dae4SAndroid Build Coastguard Worker
23*6236dae4SAndroid Build Coastguard WorkerIf curl is told to use HTTP:// for a transfer involving a hostname that exists
24*6236dae4SAndroid Build Coastguard Workerin the HSTS cache, it upgrades the transfer to use HTTPS. Each HSTS cache
25*6236dae4SAndroid Build Coastguard Workerentry has an individual life time after which the upgrade is no longer
26*6236dae4SAndroid Build Coastguard Workerperformed.
27*6236dae4SAndroid Build Coastguard Worker
28*6236dae4SAndroid Build Coastguard WorkerSpecify a "" filename (zero length) to avoid loading/saving and make curl just
29*6236dae4SAndroid Build Coastguard Workerhandle HSTS in memory.
30*6236dae4SAndroid Build Coastguard Worker
31*6236dae4SAndroid Build Coastguard WorkerIf this option is used several times, curl loads contents from all the
32*6236dae4SAndroid Build Coastguard Workerfiles but the last one is used for saving.
33