CURLOPT_FTP_SSL_CCC(3)
CURLOPT_FTP_SSL_CCC</p> π
okay bestie, settle in, because we're talking about the libcurl manual page for CURLOPT_FTP_SSL_CCC, straight out of the Library Functions Manual. she's niche, she's specific, and she's about to make your FTP-over-TLS life so much clearer (literally, you'll see). π«Ά
β¨ NAME β¨
CURLOPT_FTP_SSL_CCC β switch off SSL again with FTP after auth π
no like literally that's what she does. auth first, then the SSL goes bye-bye.
πΈ SYNOPSIS πΈ
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_SSL_CCC,
long how);
that's the whole vibe. one handle, one how, endless possibilities. π
π¦ DESCRIPTION π¦
okay so if you enable this option, libcurl goes ahead and uses CCC β that's Clear Command Channel, iykyk β and it shuts down the SSL/TLS layer after authenticating. the rest of the control channel communication remains unencrypted. yes, you read that right, unencrypted, bestie. this is a whole choice and I need you to know it. π
the reason you'd ever do this? it allows NAT routers to follow the FTP transaction. that's the whole point. that's the assignment. and honestly? kind of iconic of the NAT routers.
β οΈ important reminder: the SSL/TLS layer goes away after auth and the rest of the control channel is unencrypted. that's not a bug, that's the feature, but please know what you're signing up for π
you pass a long using one of the values below:
CURLFTPSSL_CCC_NONEβ do not attempt to use CCC. none. zero. nope. we're not doing that here. βCURLFTPSSL_CCC_PASSIVEβ do not initiate the shutdown, but wait for the server to do it. do not send a reply. she's passive, she's patient, she's letting the server take the lead. π§CURLFTPSSL_CCC_ACTIVEβ initiate the shutdown and wait for a reply. main character energy, she makes the first move and then waits for the response. π
π DEFAULT π
CURLFTPSSL_CCC_NONE
yup. the safe one. the "we don't start nothing" one. slay. π
π PROTOCOLS π
this functionality affects ftp only. that's it. that's the protocol. don't come at her with anything else. β¨
π₯ EXAMPLE π₯
here's the whole thing, copy-paste ready, no notes:
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_CONTROL);
/* go back to clear-text FTP after authenticating */
curl_easy_setopt(curl, CURLOPT_FTP_SSL_CCC, CURLFTPSSL_CCC_ACTIVE);
result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
}
see that comment in there? /* go back to clear-text FTP after authenticating */ β that's the dream, that's the storyline, that's the plot. π
β HISTORY β
CURLFTPSSL_* 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 curl and your compiler's being dramatic about types β that's why, bestie. π
π AVAILABILITY π
Added in curl 7.16.1. she's been here a minute. respect the elder. π«Ά
πΈ RETURN VALUE πΈ
curl_easy_setopt(3) returns a CURLcode indicating success or error.
CURLE_OK(0) means everything was OK. we love a zero. π- non-zero means an error occurred β see
libcurl-errors(3)for the full breakdown of what went wrong.
π SEE ALSO π
go read them, they're all part of the same little FTP-over-SSL friend group. π
okay that's the whole page!! mwah π this was CURLOPT_FTP_SSL_CCC(3) from the libcurl manual, dated 2026-10-12 β and if you ever forget a detail just come right back here, I got you. no cap. π¦β¨
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms