GNURLOPT_TLSAUTH_TYPE(3)
π GNURLOPT_TLSAUTH_TYPE(3) β like, the TLS auth one
okay so bestie, this is a page out of the curl_easy_setopt options manual (yes that's the manual name, i didn't make it up π) and it's all about CURLOPT_TLSAUTH_TYPE. it's shorter than my attention span so we'll be done in a sec π«Ά
β¨ NAME β¨
CURLOPT_TLSAUTH_TYPE β sets the TLS authentication method, no cap πΈ
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TLSAUTH_TYPE, char
*type);
β¨ DESCRIPTION β¨
so you pass a pointer to a null-terminated string as the parameter, and that string is literally the method of TLS authentication you want. the supported method is "SRP". that's it. that's the list. one (1) method. iconic minimalism π
SRPβ this is TLS-SRP authentication. Secure Remote Password auth for TLS is defined in RFC5054 and it gives you mutual authentication if both sides have a shared secret (mutual = both directions, we love a two-way street π«Ά). to actually use TLS-SRP you also have to set theCURLOPT_TLSAUTH_USERNAME(3)andCURLOPT_TLSAUTH_PASSWORD(3)options β don't forget, it's giving "forgot my keys" energy otherwise π
good news: the application does not have to keep the string around after setting this option. set it and yeet it, the string's job is done β¨
π¨ heads up: TLS SRP doesn't work with TLS 1.3. like, at all. not me finding out the hard way π
β¨ DEFAULT β¨
blank. empty. nothing. the void π³οΈ
β¨ PROTOCOLS β¨
All TLS-based protocols β every single one that does TLS π
β¨ EXAMPLE β¨
here's the whole vibe in code, copy-paste ready fr fr π
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 β¨
for this to work you need to build libcurl with GnuTLS or OpenSSL with TLS-SRP support. no SRP build, no SRP slay, sorry babe π
added in 7.21.4 β vintage but still cute β
β¨ RETURN VALUE β¨
- returns
CURLE_OKif the option is supported β - returns
CURLE_UNKNOWN_OPTIONif it's not π
β¨ SEE ALSO β¨
and that's the whole page bestie, go forth and authenticate securely π
π§ sign-off: this lil page is fromlibcurl 7.37.0, dated19 Jun 2014β yes she's an elder but she still ate π
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms