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.x
  • CURL_SSLVERSION_TLSv1_0 β€” TLSv1.0
  • CURL_SSLVERSION_TLSv1_1 β€” TLSv1.1
  • CURL_SSLVERSION_TLSv1_2 β€” TLSv1.2
  • CURL_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 as TLSv1.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 as TLSv1.0.
  • CURL_SSLVERSION_MAX_TLSv1_1 β€” the flag defines maximum supported TLS version as TLSv1.1.
  • CURL_SSLVERSION_MAX_TLSv1_2 β€” the flag defines maximum supported TLS version as TLSv1.2.
  • CURL_SSLVERSION_MAX_TLSv1_3 β€” the flag defines maximum supported TLS version as TLSv1.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