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