GNURLOPT_SSL_CIPHER_LIST(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ’– 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 🫢


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