CURLOPT\_FTPSSLAUTH(3) Library Functions Manual CURLOPT\_FTPSSLAUTH(3)

# [NAME](#NAME)

CURLOPT\_FTPSSLAUTH - order in which to attempt TLS vs SSL

# [SYNOPSIS](#SYNOPSIS)

```
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTPSSLAUTH, long order);
```

# [DESCRIPTION](#DESCRIPTION)

Pass a long using one of the values from below, to alter how libcurl issues "AUTH TLS" or "AUTH SSL" when FTP over SSL is activated. This is only interesting if [*CURLOPT\_USE\_SSL(3)*](/man/os/curl/CURLOPT_USE_SSL.3) is also set.

Possible *order* values:

[CURLFTPAUTH\_DEFAULT](#CURLFTPAUTH_DEFAULT)

Allow libcurl to decide.

[CURLFTPAUTH\_SSL](#CURLFTPAUTH_SSL)

Try "AUTH SSL" first, and only if that fails try "AUTH TLS".

[CURLFTPAUTH\_TLS](#CURLFTPAUTH_TLS)

Try "AUTH TLS" first, and only if that fails try "AUTH SSL".

# [DEFAULT](#DEFAULT)

CURLFTPAUTH\_DEFAULT

# [PROTOCOLS](#PROTOCOLS)

This functionality affects ftp only

# [EXAMPLE](#EXAMPLE)

```
int main(void)
{


  CURL *curl = curl_easy_init();


  if(curl) {


    CURLcode result;


    curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/file.txt");


    curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_TRY);


    /* funny server, ask for SSL before TLS */


    curl_easy_setopt(curl, CURLOPT_FTPSSLAUTH, CURLFTPAUTH_SSL);


    result = curl_easy_perform(curl);


    curl_easy_cleanup(curl);


  }
}
```

# [HISTORY](#HISTORY)

**CURLFTPAUTH\_*** enums became *long* types in 8.16.0, prior to this version a *long* cast was necessary when passed to [*curl\_easy\_setopt(3)*](/man/os/curl/curl_easy_setopt.3).

# [AVAILABILITY](#AVAILABILITY)

Added in curl 7.12.2

# [RETURN VALUE](#RETURN_VALUE)

[*curl\_easy\_setopt(3)*](/man/os/curl/curl_easy_setopt.3) returns a CURLcode indicating success or error.

CURLE\_OK (0) means everything was OK, non-zero means an error occurred, see [*libcurl-errors(3)*](/man/os/curl/libcurl-errors.3).

# [SEE ALSO](#SEE_ALSO)

[**CURLOPT\_FTP\_SSL\_CCC**(3)](/man/os/curl/CURLOPT_FTP_SSL_CCC.3), [**CURLOPT\_USE\_SSL**(3)](/man/os/curl/CURLOPT_USE_SSL.3)

2026-10-01 libcurl

---

Document: CURLOPT_FTPSSLAUTH(3) from curl 8.22.0-r4 (Chainguard OS)
Source: https://github.com/curl/curl.git
