CURLOPT_HSTS_CTRL.3 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 2020, 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" **************************************************************************
  22. .\"
  23. .TH CURLOPT_HSTS_CTRL 3 "4 Sep 2020" "libcurl 7.74.0" "curl_easy_setopt options"
  24. .SH NAME
  25. CURLOPT_HSTS_CTRL \- control HSTS behavior
  26. .SH SYNOPSIS
  27. .nf
  28. #include <curl/curl.h>
  29. #define CURLHSTS_ENABLE (1<<0)
  30. #define CURLHSTS_READONLYFILE (1<<1)
  31. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HSTS_CTRL, long bitmask);
  32. .fi
  33. .SH DESCRIPTION
  34. HSTS (HTTP Strict Transport Security) means that an HTTPS server can instruct
  35. the client to not contact it again over clear-text HTTP for a certain period
  36. into the future. libcurl will then automatically redirect HTTP attempts to
  37. such hosts to instead use HTTPS. This is done by libcurl retaining this
  38. knowledge in an in-memory cache.
  39. Populate the long \fIbitmask\fP with the correct set of features to instruct
  40. libcurl how to handle HSTS for the transfers using this handle.
  41. .SH BITS
  42. .IP "CURLHSTS_ENABLE"
  43. Enable the in-memory HSTS cache for this handle.
  44. .IP "CURLHSTS_READONLYFILE"
  45. Make the HSTS file (if specified) read-only - makes libcurl not save the cache
  46. to the file when closing the handle.
  47. .SH DEFAULT
  48. 0. HSTS is disabled by default.
  49. .SH PROTOCOLS
  50. HTTPS and HTTP
  51. .SH EXAMPLE
  52. .nf
  53. CURL *curl = curl_easy_init();
  54. if(curl) {
  55. curl_easy_setopt(curl, CURLOPT_HSTS_CTRL, CURLHSTS_ENABLE);
  56. curl_easy_perform(curl);
  57. }
  58. .fi
  59. .SH AVAILABILITY
  60. Added in 7.74.0
  61. .SH RETURN VALUE
  62. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  63. .SH "SEE ALSO"
  64. .BR CURLOPT_HSTS "(3), " CURLOPT_CONNECT_TO "(3), " CURLOPT_RESOLVE "(3), "
  65. .BR CURLOPT_ALTSVC "(3), "