CURLOPT_SSLVERSION.3 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 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_SSLVERSION 3 "17 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options"
  24. .SH NAME
  25. CURLOPT_SSLVERSION \- preferred TLS/SSL version
  26. .SH SYNOPSIS
  27. .nf
  28. #include <curl/curl.h>
  29. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSLVERSION, long version);
  30. .fi
  31. .SH DESCRIPTION
  32. Pass a long as parameter to control which version range of SSL/TLS versions to
  33. use.
  34. The SSL and TLS versions have typically developed from the most insecure
  35. version to be more and more secure in this order through history: SSL v2,
  36. SSLv3, TLS v1.0, TLS v1.1, TLS v1.2 and the most recent TLS v1.3.
  37. Use one of the available defines for this purpose. The available options are:
  38. .RS
  39. .IP CURL_SSLVERSION_DEFAULT
  40. The default acceptable version range. The minimum acceptable version is by
  41. default TLS v1.0 since 7.39.0 (unless the TLS library has a stricter rule).
  42. .IP CURL_SSLVERSION_TLSv1
  43. TLS v1.0 or later
  44. .IP CURL_SSLVERSION_SSLv2
  45. SSL v2 - refused
  46. .IP CURL_SSLVERSION_SSLv3
  47. SSL v3 - refused
  48. .IP CURL_SSLVERSION_TLSv1_0
  49. TLS v1.0 or later (Added in 7.34.0)
  50. .IP CURL_SSLVERSION_TLSv1_1
  51. TLS v1.1 or later (Added in 7.34.0)
  52. .IP CURL_SSLVERSION_TLSv1_2
  53. TLS v1.2 or later (Added in 7.34.0)
  54. .IP CURL_SSLVERSION_TLSv1_3
  55. TLS v1.3 or later (Added in 7.52.0)
  56. .RE
  57. The maximum TLS version can be set by using \fIone\fP of the
  58. CURL_SSLVERSION_MAX_ macros below. It is also possible to OR \fIone\fP of the
  59. CURL_SSLVERSION_ macros with \fIone\fP of the CURL_SSLVERSION_MAX_ macros.
  60. The MAX macros are not supported for WolfSSL.
  61. .RS
  62. .IP CURL_SSLVERSION_MAX_DEFAULT
  63. The flag defines the maximum supported TLS version by libcurl, or the default
  64. value from the SSL library is used. libcurl will use a sensible default
  65. maximum, which was TLS v1.2 up to before 7.61.0 and is TLS v1.3 since then -
  66. assuming the TLS library support it. (Added in 7.54.0)
  67. .IP CURL_SSLVERSION_MAX_TLSv1_0
  68. The flag defines maximum supported TLS version as TLS v1.0.
  69. (Added in 7.54.0)
  70. .IP CURL_SSLVERSION_MAX_TLSv1_1
  71. The flag defines maximum supported TLS version as TLS v1.1.
  72. (Added in 7.54.0)
  73. .IP CURL_SSLVERSION_MAX_TLSv1_2
  74. The flag defines maximum supported TLS version as TLS v1.2.
  75. (Added in 7.54.0)
  76. .IP CURL_SSLVERSION_MAX_TLSv1_3
  77. The flag defines maximum supported TLS version as TLS v1.3.
  78. (Added in 7.54.0)
  79. .RE
  80. In versions of curl prior to 7.54 the CURL_SSLVERSION_TLS options were
  81. documented to allow \fIonly\fP the specified TLS version, but behavior was
  82. inconsistent depending on the TLS library.
  83. .SH DEFAULT
  84. CURL_SSLVERSION_DEFAULT
  85. .SH PROTOCOLS
  86. All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
  87. .SH EXAMPLE
  88. .nf
  89. CURL *curl = curl_easy_init();
  90. if(curl) {
  91. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  92. /* ask libcurl to use TLS version 1.0 or later */
  93. curl_easy_setopt(curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
  94. /* Perform the request */
  95. curl_easy_perform(curl);
  96. }
  97. .fi
  98. .SH AVAILABILITY
  99. SSLv2 and SSLv3 are refused completely since curl 7.77.0
  100. SSLv2 is disabled by default since 7.18.1. Other SSL versions availability may
  101. vary depending on which backend libcurl has been built to use.
  102. SSLv3 is disabled by default since 7.39.0.
  103. .SH RETURN VALUE
  104. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  105. .SH "SEE ALSO"
  106. .BR CURLOPT_USE_SSL "(3), " CURLOPT_HTTP_VERSION "(3), "
  107. .BR CURLOPT_PROXY_SSLVERSION "(3), " CURLOPT_IPRESOLVE "(3) "