GNURLOPT_FTP_SSL_CCC(3)

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

πŸŽ€ NAME πŸŽ€

CURLOPT_FTP_SSL_CCC β€” switch off SSL again with FTP after auth

okay bestie, welcome to the gnurl curl_easy_setopt options page for GNURLOPT_FTP_SSL_CCC(3) β€” this one is all about telling FTP to drop back to clear-text after auth, and it’s lowkey iconic. πŸ’…


✨ SYNOPSIS ✨

       #include <gnurl/curl.h>

       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_SSL_CCC,
                                 long how);

πŸ¦‹ DESCRIPTION πŸ¦‹

If enabled, this option makes libcurl use CCC (Clear Command Channel). It shuts down the SSL/TLS layer after authenticating. The rest of the control channel communication will be unencrypted. This allows NAT routers to follow the FTP transaction. You pass a long using one of the values below:

  • CURLFTPSSL_CCC_NONE β€” Don’t attempt to use CCC.
  • CURLFTPSSL_CCC_PASSIVE β€” Do not initiate the shutdown, but wait for the server to do it. Do not send a reply.
  • CURLFTPSSL_CCC_ACTIVE β€” Initiate the shutdown and wait for a reply.
bestie, note the vibe: once CCC happens, the rest of the control channel is literally unencrypted. That’s the whole point, but it’s still a big mood to be aware of. 😭

πŸ’– DEFAULT πŸ’–

CURLFTPSSL_CCC_NONE β€” no CCC attempts unless you say so, periodt.


🌈 PROTOCOLS 🌈

FTP β€” that’s it, that’s the protocol. πŸ¦‹


πŸŽ€ EXAMPLE πŸŽ€

       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_CONTROL);
         /* go back to clear-text FTP after authenticating */
         curl_easy_setopt(curl, CURLOPT_FTP_SSL_CCC, CURLFTPSSL_CCC_ACTIVE);
         ret = curl_easy_perform(curl);
         curl_easy_cleanup(curl);
       }

πŸ‘‘ AVAILABILITY πŸ‘‘

Added in 7.16.1 β€” vintage but still serving. ✨


πŸ’œ RETURN VALUE πŸ’œ

Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.


πŸ”₯ SEE ALSO πŸ”₯


okay bye bestie! this page is libcurl 7.37.0, dated 19 Jun 2014, and the manual is GNURLOPT_FTP_SSL_CCC(3). mwah πŸ’‹

πŸ“¦ where this page comes from