GNURLOPT_PROXY_TLSAUTH_USERNAME(3)

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

πŸ’– GNURLOPT_PROXY_TLSAUTH_USERNAME(3) πŸ’–

okay bestie, welcome to the GNURLOPT_PROXY_TLSAUTH_USERNAME(3) page from the curl_easy_setopt options manual β€” yes, that’s the whole manual name, and it’s giving very β€œI live in the curl man pages” energy. This one is all about the proxy TLS auth username, and it’s lowkey simple but highkey important. πŸ’…


πŸŽ€ NAME πŸŽ€

CURLOPT_PROXY_TLSAUTH_USERNAME β€” the user name to use for proxy TLS authentication. That’s the vibe. πŸŽ€

✨ SYNOPSIS ✨

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_TLSAUTH_USERNAME,
       char *user);

πŸ¦‹ DESCRIPTION πŸ¦‹

So you pass a char * as the parameter, and it should point to the null-terminated username for the HTTPS proxy TLS authentication method you picked with the CURLOPT_PROXY_TLSAUTH_TYPE(3) option. It literally requires that the CURLOPT_PROXY_TLSAUTH_PASSWORD(3) option also be set β€” they’re a matching set, bestie. 🫢

And the cute part? Your app does not have to keep the string around after setting this option. Once it’s set, you can let that string go. ✨

πŸ’€ DEFAULT πŸ’€

NULL β€” that’s the default, periodt. If you don’t set it, it’s just NULL. πŸ’€

🌈 PROTOCOLS 🌈

All β€” that’s the whole list. πŸ‘‘

πŸ‘‘ EXAMPLE πŸ‘‘

Here’s the example, exactly as it appears, no cap:

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);
}

⭐ AVAILABILITY ⭐

Added in 7.52.0, bestie. ⭐

πŸ“ RETURN VALUE πŸ“

It returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if it isn’t, or CURLE_OUT_OF_MEMORY if there wasn’t enough heap space. Those are the three outcomes, and yes, CURLE_OUT_OF_MEMORY is the β€œheap said no” one. 😭

🧚 SEE ALSO 🧚


This little page comes from libcurl 7.52.0, dated 16 Nov 2016, and the footer stamp would normally say GNURLOPT_P...TH_USERNAME(3) β€” so consider that your cute archive mark. Mwah! πŸ’–

πŸ“¦ where this page comes from