CURLOPT_TLSAUTH_PASSWORD(3)
π CURLOPT_TLSAUTH_PASSWORD π
okay bestie, welcome to the Library Functions Manual entry for CURLOPT_TLSAUTH_PASSWORD β yes it's a mouthful, but it's literally the password half of TLS auth, and we're gonna slay it.
πΈ NAME πΈ
CURLOPT_TLSAUTH_PASSWORD β the password you hand over for TLS authentication. that's the whole vibe.
β¨ SYNOPSIS β¨
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TLSAUTH_PASSWORD, char *pwd);
π¦ DESCRIPTION π¦
so you pass a char * pointer as the parameter, and it should point to the null-terminated password to use for the TLS authentication method you specified with the CURLOPT_TLSAUTH_TYPE(3) option.
it requires that the CURLOPT_TLSAUTH_USERNAME(3) option also be set β they're a package deal, no cap.
good news, bestie: the application does not have to keep the string around after setting this option. set it and forget it, icon behavior.
using this option multiple times? the last set string overrides the previous ones. last one wins, periodt.
set it to NULL to disable its use again β turning it off is valid too.
β οΈ important caveat: this feature relies on TLS SRP, which does not work with TLS 1.3. so if you're on TLS 1.3, this is giving unavailable, bestie.
π DEFAULT π
NULL β that's the default, and it's giving "no password set."
π PROTOCOLS π
this functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
but backend-wise? this option works only with the following TLS backends: GnuTLS and OpenSSL. literally only those two, iykyk.
π EXAMPLE π
here's the iconic little example, copied exactly because code is sacred:
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_TLSAUTH_TYPE, "SRP");
curl_easy_setopt(curl, CURLOPT_TLSAUTH_USERNAME, "user");
curl_easy_setopt(curl, CURLOPT_TLSAUTH_PASSWORD, "secret");
result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
}
β AVAILABILITY β
added in curl 7.21.4 β vintage but still cute.
π«Ά 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 β check libcurl-errors(3) for the details.
π SEE ALSO π
that's the whole page, bestie β from the libcurl manual, dated 2026-10-12, and it's CURLOPT_TLSAUTH_PASSWORD(3) all the way down. go set that password and slay π
β¨
π¦ 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