GNURLOPT_PROXY_TLSAUTH_TYPE(3)
π GNURLOPT_PROXY_TLSAUTH_TYPE(3) β like, the proxy TLS auth method one
okay so this is one of those curl_easy_setopt options pages (that's the manual name btw, curl_easy_setopt options β hi, welcome π«Ά), and today we're talking about telling your proxy how to do TLS auth. yes bestie, your proxy can have credentials too. main character energy for proxies only π
β¨ NAME β¨
CURLOPT_PROXY_TLSAUTH_TYPE β sets the TLS authentication method(s) for your proxy. that's it, that's the vibe π
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_TLSAUTH_TYPE, char
*type);
like all the easy_setopt girlies: you pass the handle, you pass the option, you pass the value. slay β¨
β¨ DESCRIPTION β¨
so what you do is pass a pointer to a null-terminated string as the parameter. that string is supposed to be the method of the TLS authentication used for the HTTPS connection. and the one supported method is "SRP". that's the whole menu, no cap π
SRPβ TLS-SRP authentication. Secure Remote Password authentication for TLS is defined in RFC5054, and it provides mutual authentication if both sides have a shared secret. mutual!! both ways!! iconic π₯
β οΈ heads up bestie: to actually use TLS-SRP, you must also set theCURLOPT_PROXY_TLSAUTH_USERNAME(3)andCURLOPT_PROXY_TLSAUTH_PASSWORD(3)options. one does not simply SRP alone π
good news though β the application does not have to keep the string around after setting this option. libcurl copies it, so you can let your little string go free π¦
β¨ DEFAULT β¨
blank. empty. nothing. the void πΈ
β¨ PROTOCOLS β¨
All β every single one, periodt π
β¨ EXAMPLE β¨
here's the whole little routine, copy-paste ready:
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy");
curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_TYPE, "SRP");
curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_USERNAME, "user");
curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_PASSWORD, "secret");
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
see how we set the type and the username and the password? yeah. that's the requirement. we listen to the manpage in this house π
β¨ AVAILABILITY β¨
Added in 7.52.0 β vintage-ish but cute β¨
π§ also: you need to build libcurl with GnuTLS or OpenSSL with TLS-SRP support for this to work. no SRP support in your build? it's giving nothing, bestie. build it right first π
β¨ RETURN VALUE β¨
- returns
CURLE_OKif the option is supported π - returns
CURLE_UNKNOWN_OPTIONif not π
that's it. binary mood. iykyk.
β¨ SEE ALSO β¨
CURLOPT_PROXY_TLSAUTH_USERNAME(3)CURLOPT_PROXY_TLSAUTH_PASSWORD(3)CURLOPT_TLSAUTH_USERNAME(3)CURLOPT_TLSAUTH_PASSWORD(3),
(no i didn't forget the trailing comma, it's literally in the original, we keep the details fr fr π )
okay that's the whole page, bestie. go forth and authenticate your proxies responsibly. this was libcurl version 7.52.0, dated 16 Nov 2016 β an absolute era, honestly πβ stay hydrated, read your RFCs, and remember: mutual authentication is the only mutual thing you should tolerate ππ«Ά
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms