• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1---
2c: Copyright (C) Daniel Stenberg, <daniel.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)
12---
13
14# NAME
15
16CURLOPT_PROXY_SSLVERSION - preferred HTTPS proxy TLS version
17
18# SYNOPSIS
19
20~~~c
21#include <curl/curl.h>
22
23CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSLVERSION,
24                          long version);
25~~~
26
27# DESCRIPTION
28
29Pass a long as parameter to control which version of SSL/TLS to attempt to use
30when connecting to an HTTPS proxy.
31
32Use one of the available defines for this purpose. The available options are:
33
34## CURL_SSLVERSION_DEFAULT
35
36The default action. This attempts to figure out the remote SSL protocol
37version.
38
39## CURL_SSLVERSION_TLSv1
40
41TLSv1.x
42
43## CURL_SSLVERSION_TLSv1_0
44
45TLSv1.0
46
47## CURL_SSLVERSION_TLSv1_1
48
49TLSv1.1
50
51## CURL_SSLVERSION_TLSv1_2
52
53TLSv1.2
54
55## CURL_SSLVERSION_TLSv1_3
56
57TLSv1.3
58The maximum TLS version can be set by using *one* of the
59CURL_SSLVERSION_MAX_ macros below. It is also possible to OR *one* of the
60CURL_SSLVERSION_ macros with *one* of the CURL_SSLVERSION_MAX_ macros.
61The MAX macros are not supported for WolfSSL.
62
63## CURL_SSLVERSION_MAX_DEFAULT
64
65The flag defines the maximum supported TLS version as TLSv1.2, or the default
66value from the SSL library.
67(Added in 7.54.0)
68
69## CURL_SSLVERSION_MAX_TLSv1_0
70
71The flag defines maximum supported TLS version as TLSv1.0.
72(Added in 7.54.0)
73
74## CURL_SSLVERSION_MAX_TLSv1_1
75
76The flag defines maximum supported TLS version as TLSv1.1.
77(Added in 7.54.0)
78
79## CURL_SSLVERSION_MAX_TLSv1_2
80
81The flag defines maximum supported TLS version as TLSv1.2.
82(Added in 7.54.0)
83
84## CURL_SSLVERSION_MAX_TLSv1_3
85
86The flag defines maximum supported TLS version as TLSv1.3.
87(Added in 7.54.0)
88
89In versions of curl prior to 7.54 the CURL_SSLVERSION_TLS options were
90documented to allow *only* the specified TLS version, but behavior was
91inconsistent depending on the TLS library.
92
93# DEFAULT
94
95CURL_SSLVERSION_DEFAULT
96
97# PROTOCOLS
98
99All
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