CURLOPT_TLSAUTH_TYPE(3)
π CURLOPT_TLSAUTH_TYPE(3) β TLS authentication methods, bestie β¨
okay so we're in the Library Functions Manual and this is literally the page for CURLOPT_TLSAUTH_TYPE(3). Think of it as the little switch that tells libcurl which TLS authentication method you want. The supported vibe is "SRP" and that's it. periodt.
πΈ NAME πΈ
CURLOPT_TLSAUTH_TYPE β TLS authentication methods. No cap, that's the whole name-and-purpose combo.
β¨ SYNOPSIS β¨
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TLSAUTH_TYPE, char *type);
π DESCRIPTION π
You pass a pointer to a null-terminated string as parameter, bestie. The string should be the method of the TLS authentication. The supported method is "SRP".
Using this option multiple times makes the last set string override the previous ones. Set it to NULL to restore to internal default. Also super important: the application does not have to keep the string around after setting this option β libcurl is not asking you to babysit that string forever. π«Ά
SRPβ TLS-SRP authentication. Secure Remote Password authentication for TLS is defined in RFC 5054 and provides mutual authentication if both sides have a shared secret. To use TLS-SRP, you must also set theCURLOPT_TLSAUTH_USERNAME(3)andCURLOPT_TLSAUTH_PASSWORD(3)options.
π¨ important caveat, bestie: TLS SRP does not work with TLS 1.3. Like, at all. Don't try to make it happen, okay? π
π DEFAULT π
blank. That's it. A whole mood.
π¦ PROTOCOLS π¦
This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
This option works only with the following TLS backends: GnuTLS and OpenSSL.
π₯ EXAMPLE π₯
okay so here's the example, copied exactly because we do not mess with code in this group chat:
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. So yes, it's been around for a minute. π
π 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, see libcurl-errors(3).
π SEE ALSO π
π cute sign-off: source/version libcurl, date 2026-10-12, page CURLOPT_TLSAUTH_TYPE(3). slay, bye bestie! π
β¨
π¦ 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