1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_PROXY_SSLVERSION
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_HTTP_VERSION (3)
9  - CURLOPT_IPRESOLVE (3)
10  - CURLOPT_SSLVERSION (3)
11  - CURLOPT_USE_SSL (3)
12Protocol:
13  - TLS
14TLS-backend:
15  - All
16---
17
18# NAME
19
20CURLOPT_PROXY_SSLVERSION - preferred HTTPS proxy TLS version
21
22# SYNOPSIS
23
24~~~c
25#include <curl/curl.h>
26
27CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSLVERSION,
28                          long version);
29~~~
30
31# DESCRIPTION
32
33Pass a long as parameter to control which version of SSL/TLS to attempt to use
34when connecting to an HTTPS proxy.
35
36Use one of the available defines for this purpose. The available options are:
37
38## CURL_SSLVERSION_DEFAULT
39
40The default action. This attempts to figure out the remote SSL protocol
41version.
42
43## CURL_SSLVERSION_TLSv1
44
45TLSv1.x
46
47## CURL_SSLVERSION_TLSv1_0
48
49TLSv1.0
50
51## CURL_SSLVERSION_TLSv1_1
52
53TLSv1.1
54
55## CURL_SSLVERSION_TLSv1_2
56
57TLSv1.2
58
59## CURL_SSLVERSION_TLSv1_3
60
61TLSv1.3
62The maximum TLS version can be set by using *one* of the
63CURL_SSLVERSION_MAX_ macros below. It is also possible to OR *one* of the
64CURL_SSLVERSION_ macros with *one* of the CURL_SSLVERSION_MAX_ macros.
65The MAX macros are not supported for WolfSSL.
66
67## CURL_SSLVERSION_MAX_DEFAULT
68
69The flag defines the maximum supported TLS version as TLSv1.2, or the default
70value from the SSL library.
71(Added in 7.54.0)
72
73## CURL_SSLVERSION_MAX_TLSv1_0
74
75The flag defines maximum supported TLS version as TLSv1.0.
76(Added in 7.54.0)
77
78## CURL_SSLVERSION_MAX_TLSv1_1
79
80The flag defines maximum supported TLS version as TLSv1.1.
81(Added in 7.54.0)
82
83## CURL_SSLVERSION_MAX_TLSv1_2
84
85The flag defines maximum supported TLS version as TLSv1.2.
86(Added in 7.54.0)
87
88## CURL_SSLVERSION_MAX_TLSv1_3
89
90The flag defines maximum supported TLS version as TLSv1.3.
91(Added in 7.54.0)
92
93In versions of curl prior to 7.54 the CURL_SSLVERSION_TLS options were
94documented to allow *only* the specified TLS version, but behavior was
95inconsistent depending on the TLS library.
96
97# DEFAULT
98
99CURL_SSLVERSION_DEFAULT
100
101# EXAMPLE
102
103~~~c
104int main(void)
105{
106  CURL *curl = curl_easy_init();
107  if(curl) {
108    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
109
110    /* ask libcurl to use TLS version 1.0 or later */
111    curl_easy_setopt(curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
112
113    /* Perform the request */
114    curl_easy_perform(curl);
115  }
116}
117~~~
118
119# AVAILABILITY
120
121Added in 7.52.0
122
123# RETURN VALUE
124
125Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
126