1--- 2c: Copyright (C) Daniel Stenberg, <daniel@haxx.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) 11Protocol: 12 - TLS 13TLS-backend: 14 - OpenSSL 15 - GnuTLS 16Added-in: 7.21.4 17--- 18 19# NAME 20 21CURLOPT_TLSAUTH_PASSWORD - password to use for TLS authentication 22 23# SYNOPSIS 24 25~~~c 26#include <curl/curl.h> 27 28CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TLSAUTH_PASSWORD, char *pwd); 29~~~ 30 31# DESCRIPTION 32 33Pass a char pointer as parameter, which should point to the null-terminated 34password to use for the TLS authentication method specified with the 35CURLOPT_TLSAUTH_TYPE(3) option. Requires that the CURLOPT_TLSAUTH_USERNAME(3) 36option also be set. 37 38The application does not have to keep the string around after setting this 39option. 40 41Using this option multiple times makes the last set string override the 42previous ones. Set it to NULL to disable its use again. 43 44This feature relies on TLS SRP which does not work with TLS 1.3. 45 46# DEFAULT 47 48NULL 49 50# %PROTOCOLS% 51 52# EXAMPLE 53 54~~~c 55int main(void) 56{ 57 CURL *curl = curl_easy_init(); 58 if(curl) { 59 CURLcode res; 60 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); 61 curl_easy_setopt(curl, CURLOPT_TLSAUTH_TYPE, "SRP"); 62 curl_easy_setopt(curl, CURLOPT_TLSAUTH_USERNAME, "user"); 63 curl_easy_setopt(curl, CURLOPT_TLSAUTH_PASSWORD, "secret"); 64 res = curl_easy_perform(curl); 65 curl_easy_cleanup(curl); 66 } 67} 68~~~ 69 70# %AVAILABILITY% 71 72# RETURN VALUE 73 74Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or 75CURLE_OUT_OF_MEMORY if there was insufficient heap space. 76