GNURLOPT_SSL_CIPHER_LIST(3)
π GNURLOPT_SSL_CIPHER_LIST(3) π
hey bestie!! welcome to the GNURLOPT_SSL_CIPHER_LIST(3) page β it's part of the curl_easy_setopt options manual, and it's literally all about telling TLS which ciphers to use π¦β¨
πΈ NAME πΈ
CURLOPT_SSL_CIPHER_LIST β specify ciphers to use for TLS π
π¦ SYNOPSIS π¦
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_CIPHER_LIST, char *list);
π DESCRIPTION π
Okay so picture this: you pass a char * that points to a null-terminated string, and that string holds the list of ciphers you want for the SSL connection. Slay. The list must be syntactically correct β it consists of one or more cipher strings separated by colons. Commas or spaces are also acceptable separators, but colons are normally used β the normal vibe, honestly. !, -, and + can be used as operators.
For OpenSSL and GnuTLS, valid examples of cipher lists include 'RC4-SHA', Β΄SHA1+DESΒ΄, 'TLSv1', and 'DEFAULT'. The default list is normally set when you compile OpenSSL.
You'll find more details about cipher lists at this URL:
https://curl.haxx.se/docs/ssl-ciphers.html
For NSS, valid examples of cipher lists include 'rsa_rc4_128_md5', Β΄rsa_aes_128_shaΒ΄, etc.
lowkey NSS note: with NSS you don't add/remove ciphers. If one uses this option then all known ciphers are disabled and only those passed in are enabled.
For WolfSSL, valid examples of cipher lists include Β΄ECDHE-RSA-RC4-SHAΒ΄, 'AES256-SHA:AES256-SHA256', etc. πΊ
And good news: the application does not have to keep the string around after setting this option. set it and forget it, bestie.
π DEFAULT π
NULL, use internal default.
π PROTOCOLS π
All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. β¨
π EXAMPLE π
Here's the whole little C moment:
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
curl_easy_setopt(curl, CURLOPT_SSL_CIPHER_LIST, "TLSv1");
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
β AVAILABILITY β
If built TLS enabled. That's the whole condition, no cap.
π RETURN VALUE π
Returns CURLE_OK if TLS is supported, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. Memory drama? We don't love it, but at least the code tells you.
π«Ά SEE ALSO π«Ά
CURLOPT_TLS13_CIPHERS(3)CURLOPT_SSLVERSION(3)CURLOPT_PROXY_SSL_CIPHER_LIST(3)CURLOPT_PROXY_TLS13_CIPHERS(3)CURLOPT_USE_SSL(3)
xoxo, your Unix bestie π β this gem is from libcurl 7.37.0, dated 17 Jun 2014. Go configure those ciphers and slay secure πβ¨π¦
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms