1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_FTPSSLAUTH
5Section: 3
6Source: libcurl
7Protocol:
8  - FTP
9See-also:
10  - CURLOPT_FTP_SSL_CCC (3)
11  - CURLOPT_USE_SSL (3)
12Added-in: 7.12.2
13---
14
15# NAME
16
17CURLOPT_FTPSSLAUTH - order in which to attempt TLS vs SSL
18
19# SYNOPSIS
20
21~~~c
22#include <curl/curl.h>
23
24CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTPSSLAUTH, long order);
25~~~
26
27# DESCRIPTION
28
29Pass a long using one of the values from below, to alter how libcurl issues
30"AUTH TLS" or "AUTH SSL" when FTP over SSL is activated. This is only
31interesting if CURLOPT_USE_SSL(3) is also set.
32
33Possible *order* values:
34
35## CURLFTPAUTH_DEFAULT
36
37Allow libcurl to decide.
38
39## CURLFTPAUTH_SSL
40
41Try "AUTH SSL" first, and only if that fails try "AUTH TLS".
42
43## CURLFTPAUTH_TLS
44
45Try "AUTH TLS" first, and only if that fails try "AUTH SSL".
46
47# DEFAULT
48
49CURLFTPAUTH_DEFAULT
50
51# %PROTOCOLS%
52
53# EXAMPLE
54
55~~~c
56int main(void)
57{
58  CURL *curl = curl_easy_init();
59  if(curl) {
60    CURLcode res;
61    curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/file.txt");
62    curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_TRY);
63    /* funny server, ask for SSL before TLS */
64    curl_easy_setopt(curl, CURLOPT_FTPSSLAUTH, (long)CURLFTPAUTH_SSL);
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, and CURLE_UNKNOWN_OPTION if not.
76