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. 🫢

🚨 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