1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_TLSAUTH_TYPE
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_TLSAUTH_PASSWORD (3)
9  - CURLOPT_TLSAUTH_USERNAME (3)
10Protocol:
11  - TLS
12TLS-backend:
13  - OpenSSL
14  - GnuTLS
15Added-in: 7.21.4
16---
17
18# NAME
19
20CURLOPT_TLSAUTH_TYPE - TLS authentication methods
21
22# SYNOPSIS
23
24~~~c
25#include <curl/curl.h>
26
27CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TLSAUTH_TYPE, char *type);
28~~~
29
30# DESCRIPTION
31
32Pass a pointer to a null-terminated string as parameter. The string should be
33the method of the TLS authentication. Supported method is "SRP".
34
35Using this option multiple times makes the last set string override the
36previous ones. Set it to NULL to restore to internal default.
37
38The application does not have to keep the string around after setting this
39option.
40
41## SRP
42
43TLS-SRP authentication. Secure Remote Password authentication for TLS is
44defined in RFC 5054 and provides mutual authentication if both sides have a
45shared secret. To use TLS-SRP, you must also set the
46CURLOPT_TLSAUTH_USERNAME(3) and CURLOPT_TLSAUTH_PASSWORD(3) options.
47
48TLS SRP does not work with TLS 1.3.
49
50# DEFAULT
51
52blank
53
54# %PROTOCOLS%
55
56# EXAMPLE
57
58~~~c
59int main(void)
60{
61  CURL *curl = curl_easy_init();
62  if(curl) {
63    CURLcode res;
64    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
65    curl_easy_setopt(curl, CURLOPT_TLSAUTH_TYPE, "SRP");
66    curl_easy_setopt(curl, CURLOPT_TLSAUTH_USERNAME, "user");
67    curl_easy_setopt(curl, CURLOPT_TLSAUTH_PASSWORD, "secret");
68    res = curl_easy_perform(curl);
69    curl_easy_cleanup(curl);
70  }
71}
72~~~
73
74# %AVAILABILITY%
75
76# RETURN VALUE
77
78Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
79