1CURLOPT_USE_SSL(3)                  libcurl                 CURLOPT_USE_SSL(3)
2
3
4

NAME

6       CURLOPT_USE_SSL - request using SSL / TLS for the transfer
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_USE_SSL, long level);
12

DESCRIPTION

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              do not attempt to use SSL.
24
25       CURLUSESSL_TRY
26              Try using SSL, proceed as normal otherwise. Note that server may
27              close the connection if the negotiation does not succeed.
28
29       CURLUSESSL_CONTROL
30              Require  SSL  for  the   control   connection   or   fail   with
31              CURLE_USE_SSL_FAILED.
32
33       CURLUSESSL_ALL
34              Require    SSL    for    all    communication   or   fail   with
35              CURLE_USE_SSL_FAILED.
36

DEFAULT

38       CURLUSESSL_NONE
39

PROTOCOLS

41       FTP, SMTP, POP3, IMAP, LDAP
42

EXAMPLE

44       CURL *curl = curl_easy_init();
45       if(curl) {
46         curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/dir/file.ext");
47
48         /* require use of SSL for this, or fail */
49         curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL);
50
51         /* Perform the request */
52         curl_easy_perform(curl);
53       }
54

AVAILABILITY

56       Added in 7.11.0. This option was known as CURLOPT_FTP_SSL up to 7.16.4,
57       and  the  constants  were  known  as CURLFTPSSL_* Handled by LDAP since
58       7.81.0. Fully supported by the OpenLDAP backend only.
59

RETURN VALUE

61       Returns CURLE_OK if the option is supported,  and  CURLE_UNKNOWN_OPTION
62       if not.
63

SEE ALSO

65       CURLOPT_SSLVERSION(3),   CURLOPT_PROXY_SSLVERSION(3),   CURLOPT_SSL_OP‐
66       TIONS(3),
67
68
69
70ibcurl 8.2.1                    April 26, 2023              CURLOPT_USE_SSL(3)
Impressum