CURLOPT_PROXY_SSLVERSION(3)
π CURLOPT_PROXY_SSLVERSION π
okay so bestie, this is a page from the Library Functions Manual (yes, that's the manual name, we're being fancy today π) and it's all about CURLOPT_PROXY_SSLVERSION β the option that decides which TLS version your libcurl is gonna try when it links up with an HTTPS proxy. literally the vibe check for your proxy handshake β¨
πΈ NAME πΈ
CURLOPT_PROXY_SSLVERSION β your preferred HTTPS proxy TLS version, aka which TLS flavor you're serving when you talk to your proxy π
π¦ SYNOPSIS π¦
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSLVERSION,
long version);
β¨ DESCRIPTION β¨
So you pass a long as the parameter (yes, a long, we'll get to that drama in HISTORY π) and it controls which version of SSL/TLS libcurl should attempt to use when connecting to an HTTPS proxy. that's the whole assignment π
Use one of the available defines for this purpose. The available options are:
CURL_SSLVERSION_DEFAULTβ the default action, bestie. this one tries to figure out the remote SSL protocol version on its own π§CURL_SSLVERSION_TLSv1βTLSv1.xCURL_SSLVERSION_TLSv1_0βTLSv1.0CURL_SSLVERSION_TLSv1_1βTLSv1.1CURL_SSLVERSION_TLSv1_2βTLSv1.2CURL_SSLVERSION_TLSv1_3βTLSv1.3
The maximum TLS version can be set by using one of the CURL_SSLVERSION_MAX_ macros below. It is also possible to OR one of the CURL_SSLVERSION_ macros with one of the CURL_SSLVERSION_MAX_ macros. The MAX macros are not supported for wolfSSL β no cap, that's just how it is πΊπ
CURL_SSLVERSION_MAX_DEFAULTβ this flag defines the maximum supported TLS version asTLSv1.2, or the default value from the SSL library. dealer's choice, luv π²CURL_SSLVERSION_MAX_TLSv1_0β the flag defines maximum supported TLS version asTLSv1.0.CURL_SSLVERSION_MAX_TLSv1_1β the flag defines maximum supported TLS version asTLSv1.1.CURL_SSLVERSION_MAX_TLSv1_2β the flag defines maximum supported TLS version asTLSv1.2.CURL_SSLVERSION_MAX_TLSv1_3β the flag defines maximum supported TLS version asTLSv1.3.
π DEFAULT π
CURL_SSLVERSION_DEFAULT
(that's the one, the moment, the default. it's giving "let libcurl figure it out" energy π β¨)
π PROTOCOLS π
This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
And the good news? All TLS backends support this option. every single one. universal slay π«Ά
π₯ EXAMPLE π₯
okay here's the code, and note it does its thing with CURLOPT_URL and CURLOPT_SSLVERSION β copying it exactly because that's the whole point, bestie π
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
/* ask libcurl to use TLS version 1.0 or later */
curl_easy_setopt(curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
/* Perform the request */
curl_easy_perform(curl);
}
}
π¦ HISTORY π¦
CURL_SSLVERSION_* macros became long types in 8.16.0. prior to this version a long cast was necessary when passed to curl_easy_setopt(3). so if you're on old curl and things are acting weird, that's why β it's giving "era before the glow-up" ππ
β AVAILABILITY β
Added in curl 7.52.0. so if you're ancient, sorry babe π
π RETURN VALUE π
curl_easy_setopt(3) returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK, non-zero means an error occurred, see libcurl-errors(3). like, zero is the slay number, anything else means go read the errors page ππ₯
πΈ SEE ALSO πΈ
go read these next, they're all part of the same friend group π«Άβ¨
and that's the whole page, bestie!! brought to you by libcurl, dated 2026-10-12, filed under CURLOPT_PROXY_SSLVERSION(3) β periodt, go configure your proxy TLS in peace πππ¦
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms