CURLOPT_SSLVERSION.3 4.1 KB

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