1--- 2c: Copyright (C) Daniel Stenberg, <daniel.se>, et al. 3SPDX-License-Identifier: curl 4Title: CURLOPT_TLSAUTH_PASSWORD 5Section: 3 6Source: libcurl 7See-also: 8 - CURLOPT_PROXY_TLSAUTH_PASSWORD (3) 9 - CURLOPT_TLSAUTH_TYPE (3) 10 - CURLOPT_TLSAUTH_USERNAME (3) 11--- 12 13# NAME 14 15CURLOPT_TLSAUTH_PASSWORD - password to use for TLS authentication 16 17# SYNOPSIS 18 19~~~c 20#include <curl/curl.h> 21 22CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TLSAUTH_PASSWORD, char *pwd); 23~~~ 24 25# DESCRIPTION 26 27Pass a char pointer as parameter, which should point to the null-terminated 28password to use for the TLS authentication method specified with the 29CURLOPT_TLSAUTH_TYPE(3) option. Requires that the 30CURLOPT_TLSAUTH_USERNAME(3) option also be set. 31 32The application does not have to keep the string around after setting this 33option. 34 35This feature relies in TLS SRP which does not work with TLS 1.3. 36 37# DEFAULT 38 39NULL 40 41# PROTOCOLS 42 43All TLS-based protocols 44 45# EXAMPLE 46 47~~~c 48int main(void) 49{ 50 CURL *curl = curl_easy_init(); 51 if(curl) { 52 CURLcode res; 53 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); 54 curl_easy_setopt(curl, CURLOPT_TLSAUTH_TYPE, "SRP"); 55 curl_easy_setopt(curl, CURLOPT_TLSAUTH_USERNAME, "user"); 56 curl_easy_setopt(curl, CURLOPT_TLSAUTH_PASSWORD, "secret"); 57 res = curl_easy_perform(curl); 58 curl_easy_cleanup(curl); 59 } 60} 61~~~ 62 63# AVAILABILITY 64 65Added in 7.21.4, with the OpenSSL and GnuTLS backends only 66 67# RETURN VALUE 68 69Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or 70CURLE_OUT_OF_MEMORY if there was insufficient heap space. 71