1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_FTP_ALTERNATIVE_TO_USER
5Section: 3
6Source: libcurl
7Protocol:
8  - FTP
9See-also:
10  - CURLOPT_FTP_ACCOUNT (3)
11  - CURLOPT_FTP_SKIP_PASV_IP (3)
12  - CURLOPT_SERVER_RESPONSE_TIMEOUT (3)
13  - CURLOPT_USERNAME (3)
14---
15
16# NAME
17
18CURLOPT_FTP_ALTERNATIVE_TO_USER - command to use instead of USER with FTP
19
20# SYNOPSIS
21
22~~~c
23#include <curl/curl.h>
24
25CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_ALTERNATIVE_TO_USER,
26                          char *cmd);
27~~~
28
29# DESCRIPTION
30
31Pass a char pointer as parameter, pointing to a string which is used to
32authenticate if the usual FTP "USER user" and "PASS password" negotiation
33fails. This is currently only known to be required when connecting to
34Tumbleweed's Secure Transport FTPS server using client certificates for
35authentication.
36
37The application does not have to keep the string around after setting this
38option.
39
40# DEFAULT
41
42NULL
43
44# EXAMPLE
45
46~~~c
47int main(void)
48{
49  CURL *curl = curl_easy_init();
50  if(curl) {
51    CURLcode res;
52    curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/foo.bin");
53    curl_easy_setopt(curl, CURLOPT_FTP_ALTERNATIVE_TO_USER, "two users");
54    res = curl_easy_perform(curl);
55
56    curl_easy_cleanup(curl);
57  }
58}
59~~~
60
61# AVAILABILITY
62
63Added in 7.15.5
64
65# RETURN VALUE
66
67Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
68CURLE_OUT_OF_MEMORY if there was insufficient heap space.
69