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