CURLOPT_FTPSSLAUTH(3)

πŸ’… CURLOPT_FTPSSLAUTH πŸ’…

ok so this is a page from the libcurl manual (Library Functions Manual), and it's about CURLOPT_FTPSSLAUTH β€” the icon of "which one do we try first, TLS or SSL?" ✨


🌸 NAME 🌸

CURLOPT_FTPSSLAUTH β€” the order in which to attempt TLS vs SSL πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <curl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTPSSLAUTH, long order);

✨ DESCRIPTION ✨

bestie, you pass a long in here using one of the values from below πŸ‘‡ and it alters how libcurl issues "AUTH TLS" or "AUTH SSL" when FTP over SSL is activated. basically you're deciding who goes first, no cap.

heads up: this is only interesting if CURLOPT_USE_SSL(3) is also set. otherwise it's just sitting there, main character energy with no plot 😭

Possible order values:

  • CURLFTPAUTH_DEFAULT β€” let libcurl decide, she's got this πŸ’…
  • 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

(the classic "libcurl knows best" vibe πŸ’–)


🌈 PROTOCOLS 🌈

idk this one's exclusive β€” this functionality affects ftp only 🐟


πŸ”₯ EXAMPLE πŸ”₯

here's the whole thing, literally:

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);
  }
}

see that comment? /* funny server, ask for SSL before TLS */ β€” yeah, sometimes the server's just quirky like that 🫢


🧚 HISTORY 🧚

ok so lore drop πŸ“–: the 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). so if you're on old code and seeing casts, that's why, iykyk πŸ’€


⭐ AVAILABILITY ⭐

added in curl 7.12.2 β€” vintage but still slaying πŸ‘‘


πŸ’œ RETURN VALUE πŸ’œ

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)

πŸ“ SEE ALSO πŸ“


that's the whole page bestie, go configure something iconic πŸ’…βœ¨

sign-off szn: this was the libcurl manual page, dated 2026-10-12 🌸 β€” catch you on the next one, love u 🫢

πŸ“¦ where this page comes from