CURLOPT_SSL_CIPHER_LIST(3)
π NAME π
hey bestie π«Ά you're looking at CURLOPT_SSL_CIPHER_LIST(3) from the Library Functions Manual, and she's all about CURLOPT_SSL_CIPHER_LIST β the ciphers to use for TLS. no cap, this one's giving secure-connection main character energy β¨
β¨ SYNOPSIS β¨
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_CIPHER_LIST, char *list);
π DESCRIPTION π
okay so you pass a char pointer, pointing to a null-terminated string holding the list of cipher suites to use for the TLS 1.2 (1.1, 1.0) connection. the list has to be syntactically correct, periodt β it consists of one or more cipher suite strings separated by colons π«Ά
for setting TLS 1.3 ciphers, see CURLOPT_TLS13_CIPHERS(3) π
a valid example of a cipher list with OpenSSL is:
"ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:"
"ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305"
for Schannel, you can use this option to set algorithms but not specific cipher suites. refer to the ciphers lists document for algorithms π
GnuTLS has the concept of a priority string which has its own syntax and keywords. the string set via CURLOPT_SSL_CIPHER_LIST(3) directly influences the priority setting. the priority string doc lives here: https://gnutls.org/manual/html_node/Priority-Strings.html πΈ
find more details about cipher lists on this URL:
https://curl.se/docs/ssl-ciphers.html
the application does not have to keep the string around after setting this option β so let that string go, bestie, it's fine π
using this option multiple times makes the last set string override the previous ones. set it to NULL to disable its use again π¦
π¦ DEFAULT π¦
NULL, use built-in list π
πΈ PROTOCOLS πΈ
this functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. β¨
this option works only with the following TLS backends: GnuTLS, OpenSSL, Rustls, Schannel, mbedTLS and wolfSSL π
π EXAMPLE π
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
curl_easy_setopt(curl, CURLOPT_SSL_CIPHER_LIST,
"ECDHE-ECDSA-CHACHA20-POLY1305:"
"ECDHE-RSA-CHACHA20-POLY1305");
result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
}
π§ HISTORY π§
- OpenSSL support added in
7.9. - wolfSSL support added in
7.53.0. - Schannel support added in
7.61.0. - mbedTLS support added in
8.8.0. - Rustls support added in
8.10.0.
π¨ since curl8.10.0returnsCURLE_NOT_BUILT_INwhen not supported. that's the vibe check, bestie π
β AVAILABILITY β
added in curl 7.9 π«Ά
π₯ RETURN VALUE π₯
curl_easy_setopt(3) returns a CURLcode indicating success or error. β¨
CURLE_OK (0) means everything was OK, non-zero means an error occurred, see libcurl-errors(3) π
π SEE ALSO π
CURLOPT_PROXY_SSL_CIPHER_LIST(3)CURLOPT_PROXY_TLS13_CIPHERS(3)CURLOPT_SSLVERSION(3)CURLOPT_TLS13_CIPHERS(3)CURLOPT_USE_SSL(3)
mwah π source: libcurl, date: 2026-10-12, page: CURLOPT_SSL_CIPHER_LIST(3) β she ate and left no crumbs π
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms