1 #ifndef HEADER_CURL_HSTS_H
2 #define HEADER_CURL_HSTS_H
3 /***************************************************************************
5 * Project ___| | | | _ \| |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 2020 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
12 * This software is licensed as described in the file COPYING, which
13 * you should have received as part of this distribution. The terms
14 * are also available at https://curl.se/docs/copyright.html.
16 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 * copies of the Software, and permit persons to whom the Software is
18 * furnished to do so, under the terms of the COPYING file.
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
23 * SPDX-License-Identifier: curl
25 ***************************************************************************/
26 #include "curl_setup.h"
28 #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_HSTS)
29 #include <curl/curl.h>
33 extern time_t deltatime;
37 struct Curl_llist_element node;
39 bool includeSubDomains;
40 curl_off_t expires; /* the timestamp of this entry's expiry */
43 /* The HSTS cache. Needs to be able to tailmatch host names. */
45 struct Curl_llist list;
50 struct hsts *Curl_hsts_init(void);
51 void Curl_hsts_cleanup(struct hsts **hp);
52 CURLcode Curl_hsts_parse(struct hsts *h, const char *hostname,
54 struct stsentry *Curl_hsts(struct hsts *h, const char *hostname,
56 CURLcode Curl_hsts_save(struct Curl_easy *data, struct hsts *h,
58 CURLcode Curl_hsts_loadfile(struct Curl_easy *data,
59 struct hsts *h, const char *file);
60 CURLcode Curl_hsts_loadcb(struct Curl_easy *data,
63 #define Curl_hsts_cleanup(x)
64 #define Curl_hsts_loadcb(x,y) CURLE_OK
65 #define Curl_hsts_save(x,y,z)
66 #endif /* CURL_DISABLE_HTTP || CURL_DISABLE_HSTS */
67 #endif /* HEADER_CURL_HSTS_H */