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) 12--- 13 14# NAME 15 16CURLOPT_FTPSSLAUTH - order in which to attempt TLS vs SSL 17 18# SYNOPSIS 19 20~~~c 21#include <curl/curl.h> 22 23CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTPSSLAUTH, long order); 24~~~ 25 26# DESCRIPTION 27 28Pass a long using one of the values from below, to alter how libcurl issues 29"AUTH TLS" or "AUTH SSL" when FTP over SSL is activated. This is only 30interesting if CURLOPT_USE_SSL(3) is also set. 31 32Possible *order* values: 33 34## CURLFTPAUTH_DEFAULT 35 36Allow libcurl to decide. 37 38## CURLFTPAUTH_SSL 39 40Try "AUTH SSL" first, and only if that fails try "AUTH TLS". 41 42## CURLFTPAUTH_TLS 43 44Try "AUTH TLS" first, and only if that fails try "AUTH SSL". 45 46# DEFAULT 47 48CURLFTPAUTH_DEFAULT 49 50# EXAMPLE 51 52~~~c 53int main(void) 54{ 55 CURL *curl = curl_easy_init(); 56 if(curl) { 57 CURLcode res; 58 curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/file.txt"); 59 curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_TRY); 60 /* funny server, ask for SSL before TLS */ 61 curl_easy_setopt(curl, CURLOPT_FTPSSLAUTH, (long)CURLFTPAUTH_SSL); 62 res = curl_easy_perform(curl); 63 curl_easy_cleanup(curl); 64 } 65} 66~~~ 67 68# AVAILABILITY 69 70Added in 7.12.2 71 72# RETURN VALUE 73 74Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. 75