CURLOPT_PR...H_USERNAME(3)
π CURLOPT_PROXY_TLSAUTH_USERNAME(3) β the glam little page from libcurl's Library Functions Manual
okay so bestie, picture this: you're doing TLS auth to a proxy (yes, a proxy, not the server, keep up β¨) and the proxy wants a username. That's literally what this option is for. It's the proxy-side sibling of the regular TLS auth username, and she's giving "supporting character but make it essential" energy. π
Heads up, the header of this page gets truncated to CURLOPT_PR...H_USERNAME(3) because the name is lowkey too long for the man page column, but you and I both know what she's called. π
β¨ NAME β¨
CURLOPT_PROXY_TLSAUTH_USERNAME β the username to use for proxy TLS authentication π«Ά
πΈ SYNOPSIS πΈ
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_TLSAUTH_USERNAME,
char *user);
π¦ DESCRIPTION π¦
So you pass a char pointer as the parameter, and it should point to a null-terminated username string. That string is what gets used for the HTTPS proxy TLS authentication method you picked over in CURLOPT_PROXY_TLSAUTH_TYPE(3). π
Big requirement though: this option needs CURLOPT_PROXY_TLSAUTH_PASSWORD(3) to also be set. It's a two-piece outfit, you can't wear just the top. π
Good news for your memory management anxiety: the application does not have to keep the string around after setting this option. Set it and forget it, she's copied. β¨
And if you're the type to set this multiple times (no judgement, we've all been there π): the last set string overrides the previous ones. Setting it to NULL disables its use again, like a clean slate moment. π
π DEFAULT π
NULL
(no username, no proxy TLS auth username-ing, that's the vibe)
π₯ PROTOCOLS π₯
This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. Basically if it's got an S on the end and TLS in its soul, she's in. β
β οΈ but here's the catch, bestie: this option works only with the following TLS backends: GnuTLS and OpenSSL. If you're on a different backend, this is not your moment. π
π EXAMPLE π
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example");
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");
result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
}
look at her. URL set, proxy set, SRP chosen, username "user", password "secret", perform, cleanup. The whole little routine, no cap. π§
π AVAILABILITY π
Added in curl 7.52.0 β so she's been iconic since 2016, iykyk. π
π 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 β go check libcurl-errors(3) for the tea. π
π SEE ALSO π
CURLOPT_PROXY_TLSAUTH_PASSWORD(3)CURLOPT_PROXY_TLSAUTH_TYPE(3)CURLOPT_TLSAUTH_PASSWORD(3)CURLOPT_TLSAUTH_TYPE(3)
and that's the page, bestie π«Ά mwah π
πΈ sign-off szn: this gem is from libcurl, dated 2026-10-12, and its footer name is the ever-truncated CURLOPT_PR...H_USERNAME(3). periodt. β¨
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms