GNURLOPT_FTPSSLAUTH(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ’– 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