1CURLOPT_USE_SSL(3) curl_easy_setopt options CURLOPT_USE_SSL(3)
2
3
4
6 CURLOPT_USE_SSL - request using SSL / TLS for the transfer
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_USE_SSL, long level);
12
14 Pass a long using one of the values from below, to make libcurl use
15 your desired level of SSL for the transfer.
16
17 These are all protocols that start out plain text and get "upgraded" to
18 SSL using the STARTTLS command.
19
20 This is for enabling SSL/TLS when you use FTP, SMTP, POP3, IMAP etc.
21
22 CURLUSESSL_NONE
23 Don't attempt to use SSL.
24
25 CURLUSESSL_TRY
26 Try using SSL, proceed as normal otherwise.
27
28 CURLUSESSL_CONTROL
29 Require SSL for the control connection or fail with
30 CURLE_USE_SSL_FAILED.
31
32 CURLUSESSL_ALL
33 Require SSL for all communication or fail with
34 CURLE_USE_SSL_FAILED.
35
37 CURLUSESSL_NONE
38
40 FTP, SMTP, POP3, IMAP
41
43 CURL *curl = curl_easy_init();
44 if(curl) {
45 curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/dir/file.ext");
46
47 /* require use of SSL for this, or fail */
48 curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL);
49
50 /* Perform the request */
51 curl_easy_perform(curl);
52 }
53
55 Added in 7.11.0. This option was known as CURLOPT_FTP_SSL up to 7.16.4,
56 and the constants were known as CURLFTPSSL_*
57
59 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
60 if not.
61
63 CURLOPT_SSLVERSION(3), CURLOPT_PROXY_SSLVERSION(3), CUR‐
64 LOPT_SSL_OPTIONS(3),
65
66
67
68libcurl 7.66.0 October 10, 2018 CURLOPT_USE_SSL(3)