GNURLOPT_PROXY_TLSAUTH_TYPE(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ’… 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 the CURLOPT_PROXY_TLSAUTH_USERNAME(3) and CURLOPT_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_OK if the option is supported 😌
  • returns CURLE_UNKNOWN_OPTION if not πŸ™ˆ

that's it. binary mood. iykyk.


✨ SEE ALSO ✨

(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