1--- 2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3SPDX-License-Identifier: curl 4Title: CURLOPT_FTP_SSL_CCC 5Section: 3 6Source: libcurl 7Protocol: 8 - FTP 9See-also: 10 - CURLOPT_FTPSSLAUTH (3) 11 - CURLOPT_PROTOCOLS_STR (3) 12 - CURLOPT_USE_SSL (3) 13--- 14 15# NAME 16 17CURLOPT_FTP_SSL_CCC - switch off SSL again with FTP after auth 18 19# SYNOPSIS 20 21~~~c 22#include <curl/curl.h> 23 24CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_SSL_CCC, 25 long how); 26~~~ 27 28# DESCRIPTION 29 30If enabled, this option makes libcurl use CCC (Clear Command Channel). It 31shuts down the SSL/TLS layer after authenticating. The rest of the control 32channel communication remains unencrypted. This allows NAT routers to follow 33the FTP transaction. Pass a long using one of the values below 34 35## CURLFTPSSL_CCC_NONE 36 37do not attempt to use CCC. 38 39## CURLFTPSSL_CCC_PASSIVE 40 41Do not initiate the shutdown, but wait for the server to do it. Do not send a 42reply. 43 44## CURLFTPSSL_CCC_ACTIVE 45 46Initiate the shutdown and wait for a reply. 47 48# DEFAULT 49 50CURLFTPSSL_CCC_NONE 51 52# EXAMPLE 53 54~~~c 55int main(void) 56{ 57 CURL *curl = curl_easy_init(); 58 if(curl) { 59 CURLcode res; 60 curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/file.txt"); 61 curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_CONTROL); 62 /* go back to clear-text FTP after authenticating */ 63 curl_easy_setopt(curl, CURLOPT_FTP_SSL_CCC, (long)CURLFTPSSL_CCC_ACTIVE); 64 res = curl_easy_perform(curl); 65 curl_easy_cleanup(curl); 66 } 67} 68~~~ 69 70# AVAILABILITY 71 72Added in 7.16.1 73 74# RETURN VALUE 75 76Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. 77