1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_PROXY_TLSAUTH_USERNAME
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_PROXY_TLSAUTH_PASSWORD (3)
9  - CURLOPT_PROXY_TLSAUTH_TYPE (3)
10  - CURLOPT_TLSAUTH_PASSWORD (3)
11  - CURLOPT_TLSAUTH_TYPE (3)
12Protocol:
13  - TLS
14TLS-backend:
15  - OpenSSL
16  - GnuTLS
17Added-in: 7.52.0
18---
19
20# NAME
21
22CURLOPT_PROXY_TLSAUTH_USERNAME - username to use for proxy TLS authentication
23
24# SYNOPSIS
25
26~~~c
27#include <curl/curl.h>
28
29CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_TLSAUTH_USERNAME,
30                          char *user);
31~~~
32
33# DESCRIPTION
34
35Pass a char pointer as parameter, which should point to the null-terminated
36username to use for the HTTPS proxy TLS authentication method specified with
37the CURLOPT_PROXY_TLSAUTH_TYPE(3) option. Requires that the
38CURLOPT_PROXY_TLSAUTH_PASSWORD(3) option also be set.
39
40The application does not have to keep the string around after setting this
41option.
42
43Using this option multiple times makes the last set string override the
44previous ones. Set it to NULL to disable its use again.
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_PROXY, "https://proxy");
62    curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_TYPE, "SRP");
63    curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_USERNAME, "user");
64    curl_easy_setopt(curl, CURLOPT_PROXY_TLSAUTH_PASSWORD, "secret");
65    res = curl_easy_perform(curl);
66    curl_easy_cleanup(curl);
67  }
68}
69~~~
70
71# %AVAILABILITY%
72
73# RETURN VALUE
74
75Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
76CURLE_OUT_OF_MEMORY if there was insufficient heap space.
77