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