• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1---
2c: Copyright (C) Daniel Stenberg, <daniel.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_SSL_CIPHER_LIST
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_PROXY_SSL_CIPHER_LIST (3)
9  - CURLOPT_PROXY_TLS13_CIPHERS (3)
10  - CURLOPT_SSLVERSION (3)
11  - CURLOPT_TLS13_CIPHERS (3)
12  - CURLOPT_USE_SSL (3)
13---
14
15# NAME
16
17CURLOPT_SSL_CIPHER_LIST - ciphers to use for TLS
18
19# SYNOPSIS
20
21~~~c
22#include <curl/curl.h>
23
24CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_CIPHER_LIST, char *list);
25~~~
26
27# DESCRIPTION
28
29Pass a char pointer, pointing to a null-terminated string holding the list of
30ciphers to use for the SSL connection. The list must be syntactically correct,
31it consists of one or more cipher strings separated by colons. Commas or
32spaces are also acceptable separators but colons are normally used, !, - and
33+ can be used as operators.
34
35For OpenSSL and GnuTLS valid examples of cipher lists include **RC4-SHA**,
36**SHA1+DES**, **TLSv1** and **DEFAULT**. The default list is normally set when
37you compile OpenSSL.
38
39For WolfSSL, valid examples of cipher lists include **ECDHE-RSA-RC4-SHA**,
40**AES256-SHA:AES256-SHA256**, etc.
41
42For BearSSL, valid examples of cipher lists include
43**ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256**, or when using
44IANA names
45**TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256**,
46etc. With BearSSL you do not add/remove ciphers. If one uses this option then
47all known ciphers are disabled and only those passed in are enabled.
48
49For Schannel, you can use this option to set algorithms but not specific
50cipher suites. Refer to the ciphers lists document for algorithms.
51
52Find more details about cipher lists on this URL:
53
54 https://curl.se/docs/ssl-ciphers.html
55
56The application does not have to keep the string around after setting this
57option.
58
59# DEFAULT
60
61NULL, use internal default
62
63# PROTOCOLS
64
65All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
66
67# EXAMPLE
68
69~~~c
70int main(void)
71{
72  CURL *curl = curl_easy_init();
73  if(curl) {
74    CURLcode res;
75    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
76    curl_easy_setopt(curl, CURLOPT_SSL_CIPHER_LIST, "TLSv1");
77    res = curl_easy_perform(curl);
78    curl_easy_cleanup(curl);
79  }
80}
81~~~
82
83# AVAILABILITY
84
85Added in 7.9, in 7.83.0 for BearSSL
86
87If built TLS enabled.
88
89# RETURN VALUE
90
91Returns CURLE_OK if TLS is supported, CURLE_UNKNOWN_OPTION if not, or
92CURLE_OUT_OF_MEMORY if there was insufficient heap space.
93