GNURLOPT_FTPSSLAUTH(3)
π NAME π
Okay bestie π you're on GNURLOPT_FTPSSLAUTH(3) from the curl_easy_setopt options manual. The actual option here is CURLOPT_FTPSSLAUTH β it sets the order in which to attempt TLS vs SSL when using FTP. That's the tea.
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTPSSLAUTH, long order);
π DESCRIPTION π
Pass a long using one of the values from below, bestie. It alters how libcurl issues "AUTH TLS" or "AUTH SSL" when FTP over SSL is activated. This is only interesting if CURLOPT_USE_SSL(3) is also set β iykyk.
Possible order values:
CURLFTPAUTH_DEFAULTβ allow libcurl to decide. Main character energy, honestly.CURLFTPAUTH_SSLβ try"AUTH SSL"first, and only if that fails try"AUTH TLS".CURLFTPAUTH_TLSβ try"AUTH TLS"first, and only if that fails try"AUTH SSL".
π DEFAULT π
CURLFTPAUTH_DEFAULT β that's the default, periodt.
π PROTOCOLS π
FTP β that's it.
π₯ EXAMPLE π₯
Here's the example, exactly as the page serves it:
CURL *curl = curl_easy_init();
if(curl) {
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);
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
β AVAILABILITY β
Added in 7.12.2 β vintage but still cute.
π RETURN VALUE π
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. Simple.
π«Ά SEE ALSO π«Ά
Go give these a lil read:
That's the whole page, bestie π it's from libcurl 7.37.0, dated 19 Jun 2014, and its manual-page name is GNURLOPT_FTPSSLAUTH(3). Mwah π§β¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms