CURLOPT_SSL_OPTIONS.3 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. .\" generated by cd2nroff 0.1 from CURLOPT_SSL_OPTIONS.md
  2. .TH CURLOPT_SSL_OPTIONS 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_SSL_OPTIONS \- SSL behavior options
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_OPTIONS, long bitmask);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass a long with a bitmask to tell libcurl about specific SSL
  12. behaviors. Available bits:
  13. .IP CURLSSLOPT_ALLOW_BEAST
  14. Tells libcurl to not attempt to use any workarounds for a security flaw in the
  15. SSL3 and TLS1.0 protocols. If this option is not used or this bit is set to 0,
  16. the SSL layer libcurl uses may use a work\-around for this flaw although it
  17. might cause interoperability problems with some (older) SSL implementations.
  18. WARNING: avoiding this work\-around lessens the security, and by setting this
  19. option to 1 you ask for exactly that. This option is only supported for Secure
  20. Transport and OpenSSL.
  21. .IP CURLSSLOPT_NO_REVOKE
  22. Tells libcurl to disable certificate revocation checks for those SSL backends
  23. where such behavior is present. This option is only supported for Schannel
  24. (the native Windows SSL library), with an exception in the case of Windows\(aq
  25. Untrusted Publishers block list which it seems cannot be bypassed. (Added in
  26. 7.44.0)
  27. .IP CURLSSLOPT_NO_PARTIALCHAIN
  28. Tells libcurl to not accept "partial" certificate chains, which it otherwise
  29. does by default. This option is only supported for OpenSSL and fails the
  30. certificate verification if the chain ends with an intermediate certificate
  31. and not with a root cert. (Added in 7.68.0)
  32. .IP CURLSSLOPT_REVOKE_BEST_EFFORT
  33. Tells libcurl to ignore certificate revocation checks in case of missing or
  34. offline distribution points for those SSL backends where such behavior is
  35. present. This option is only supported for Schannel (the native Windows SSL
  36. library). If combined with \fICURLSSLOPT_NO_REVOKE\fP, the latter takes
  37. precedence. (Added in 7.70.0)
  38. .IP CURLSSLOPT_NATIVE_CA
  39. Tell libcurl to use the operating system\(aqs native CA store for certificate
  40. verification. If you set this option and also set a CA certificate file or
  41. directory then during verification those certificates are searched in addition
  42. to the native CA store.
  43. Works with wolfSSL on Windows, Linux (Debian, Ubuntu, Gentoo, Fedora, RHEL),
  44. macOS, Android and iOS (added in 8.3.0), with GnuTLS (added in 8.5.0) or on
  45. Windows when built to use OpenSSL (Added in 7.71.0).
  46. .IP CURLSSLOPT_AUTO_CLIENT_CERT
  47. Tell libcurl to automatically locate and use a client certificate for
  48. authentication, when requested by the server. This option is only supported
  49. for Schannel (the native Windows SSL library). Prior to 7.77.0 this was the
  50. default behavior in libcurl with Schannel. Since the server can request any
  51. certificate that supports client authentication in the OS certificate store it
  52. could be a privacy violation and unexpected.
  53. (Added in 7.77.0)
  54. .SH DEFAULT
  55. 0
  56. .SH PROTOCOLS
  57. This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
  58. All TLS backends support this option.
  59. .SH EXAMPLE
  60. .nf
  61. int main(void)
  62. {
  63. CURL *curl = curl_easy_init();
  64. if(curl) {
  65. CURLcode res;
  66. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  67. /* weaken TLS only for use with silly servers */
  68. curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, (long)CURLSSLOPT_ALLOW_BEAST |
  69. CURLSSLOPT_NO_REVOKE);
  70. res = curl_easy_perform(curl);
  71. curl_easy_cleanup(curl);
  72. }
  73. }
  74. .fi
  75. .SH AVAILABILITY
  76. Added in curl 7.25.0
  77. .SH RETURN VALUE
  78. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  79. .SH SEE ALSO
  80. .BR CURLOPT_PROXY_SSL_OPTIONS (3),
  81. .BR CURLOPT_SSLVERSION (3),
  82. .BR CURLOPT_SSL_CIPHER_LIST (3)