GNURLOPT_TLSAUTH_USERNAME(3)

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

✨ NAME ✨

okay bestie, this is the GNURLOPT_TLSAUTH_USERNAME(3) page, and it's literally about CURLOPT_TLSAUTH_USERNAME β€” the user name to use for TLS authentication πŸ’… like, the username half of your TLS auth setup, no cap.

πŸŽ€ SYNOPSIS πŸŽ€

the whole signature vibe:

#include <gnurl/curl.h>

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

πŸ’– DESCRIPTION πŸ’–

Pass a char * as the parameter, bestie. It should point to the null-terminated username to use for the TLS authentication method you specified with the CURLOPT_TLSAUTH_TYPE(3) option. It requires that the CURLOPT_TLSAUTH_PASSWORD(3) option also be set β€” both halves, periodt.

The application does not have to keep the string around after setting this option. So you can let it go after it's set; no need to babysit the string 🫢.

⚠️ this feature relies on TLS SRP, which doesn't work with TLS 1.3. That's the caveat, bestie β€” SRP + TLS 1.3 is not it 😭.

🌸 DEFAULT 🌸

NULL β€” the default is literally NULL, iconic empty-slot energy πŸ™ˆ.

πŸ¦‹ PROTOCOLS πŸ¦‹

All TLS-based protocols ✨

πŸ’… EXAMPLE πŸ’…

copy-paste this little cutie:

CURL *curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  curl_easy_setopt(curl, CURLOPT_TLSAUTH_TYPE, "SRP");
  curl_easy_setopt(curl, CURLOPT_TLSAUTH_USERNAME, "user");
  curl_easy_setopt(curl, CURLOPT_TLSAUTH_PASSWORD, "secret");
  ret = curl_easy_perform(curl);
  curl_easy_cleanup(curl);
}

⭐ AVAILABILITY ⭐

Added in 7.21.4 ✨

πŸ”₯ RETURN VALUE πŸ”₯

Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. Like, the return value is giving error-code realness 😭.

πŸ‘‘ SEE ALSO πŸ‘‘

mwah πŸ’‹ β€” this page is from libcurl 7.37.0, dated 19 Jun 2014. bye bestie, go set that TLS auth username 🫢

πŸ“¦ where this page comes from