CURLOPT_TLSAUTH_USERNAME.3 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. .\" generated by cd2nroff 0.1 from CURLOPT_TLSAUTH_USERNAME.md
  2. .TH CURLOPT_TLSAUTH_USERNAME 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_TLSAUTH_USERNAME \- username to use for TLS authentication
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TLSAUTH_USERNAME, char *user);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass a char pointer as parameter, which should point to the null\-terminated
  12. username to use for the TLS authentication method specified with the
  13. \fICURLOPT_TLSAUTH_TYPE(3)\fP option. Requires that the \fICURLOPT_TLSAUTH_PASSWORD(3)\fP
  14. option also be set.
  15. The application does not have to keep the string around after setting this
  16. option.
  17. This feature relies on TLS SRP which does not work with TLS 1.3.
  18. .SH DEFAULT
  19. NULL
  20. .SH PROTOCOLS
  21. This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
  22. This option works only with the following TLS backends:
  23. GnuTLS and OpenSSL
  24. .SH EXAMPLE
  25. .nf
  26. int main(void)
  27. {
  28. CURL *curl = curl_easy_init();
  29. if(curl) {
  30. CURLcode res;
  31. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  32. curl_easy_setopt(curl, CURLOPT_TLSAUTH_TYPE, "SRP");
  33. curl_easy_setopt(curl, CURLOPT_TLSAUTH_USERNAME, "user");
  34. curl_easy_setopt(curl, CURLOPT_TLSAUTH_PASSWORD, "secret");
  35. res = curl_easy_perform(curl);
  36. curl_easy_cleanup(curl);
  37. }
  38. }
  39. .fi
  40. .SH AVAILABILITY
  41. Added in curl 7.21.4
  42. .SH RETURN VALUE
  43. Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
  44. CURLE_OUT_OF_MEMORY if there was insufficient heap space.
  45. .SH SEE ALSO
  46. .BR CURLOPT_TLSAUTH_PASSWORD (3),
  47. .BR CURLOPT_TLSAUTH_TYPE (3)