CURLOPT_FTPSSLAUTH.md (1550B)
1 --- 2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 SPDX-License-Identifier: curl 4 Title: CURLOPT_FTPSSLAUTH 5 Section: 3 6 Source: libcurl 7 Protocol: 8 - FTP 9 See-also: 10 - CURLOPT_FTP_SSL_CCC (3) 11 - CURLOPT_USE_SSL (3) 12 Added-in: 7.12.2 13 --- 14 15 # NAME 16 17 CURLOPT_FTPSSLAUTH - order in which to attempt TLS vs SSL 18 19 # SYNOPSIS 20 21 ~~~c 22 #include <curl/curl.h> 23 24 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTPSSLAUTH, long order); 25 ~~~ 26 27 # DESCRIPTION 28 29 Pass 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 31 interesting if CURLOPT_USE_SSL(3) is also set. 32 33 Possible *order* values: 34 35 ## CURLFTPAUTH_DEFAULT 36 37 Allow libcurl to decide. 38 39 ## CURLFTPAUTH_SSL 40 41 Try "AUTH SSL" first, and only if that fails try "AUTH TLS". 42 43 ## CURLFTPAUTH_TLS 44 45 Try "AUTH TLS" first, and only if that fails try "AUTH SSL". 46 47 # DEFAULT 48 49 CURLFTPAUTH_DEFAULT 50 51 # %PROTOCOLS% 52 53 # EXAMPLE 54 55 ~~~c 56 int 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 75 curl_easy_setopt(3) returns a CURLcode indicating success or error. 76 77 CURLE_OK (0) means everything was OK, non-zero means an error occurred, see 78 libcurl-errors(3).