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