GNURLOPT_USE_SSL(3)

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

πŸ’– GNURLOPT_USE_SSL(3) πŸ’–

okay bestie, welcome to the curl_easy_setopt options manual β€” this page is GNURLOPT_USE_SSL(3), and it's all about making libcurl use your fave level of SSL/TLS on a transfer. slay. ✨

🌸 NAME 🌸

CURLOPT_USE_SSL β€” request using SSL / TLS for the transfer. that's the whole name, no cap. πŸ’…

✨ SYNOPSIS ✨

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_USE_SSL, long level);

πŸ’– DESCRIPTION πŸ’–

Pass a long using one of the values from below, to make libcurl use your desired level of SSL for the transfer. literally pick your level, bestie. πŸŽ€

These are all protocols that start out plain text and get "upgraded" to SSL using the STARTTLS command. that's the whole plot. 😭

This is for enabling SSL/TLS when you use FTP, SMTP, POP3, IMAP etc. iykyk. πŸ¦‹

  • CURLUSESSL_NONE β€” Don't attempt to use SSL. πŸ™ˆ
  • CURLUSESSL_TRY β€” Try using SSL, proceed as normal otherwise. ✨
  • CURLUSESSL_CONTROL β€” Require SSL for the control connection or fail with CURLE_USE_SSL_FAILED. πŸ’…
  • CURLUSESSL_ALL β€” Require SSL for all communication or fail with CURLE_USE_SSL_FAILED. πŸ”₯

πŸŽ€ DEFAULT πŸŽ€

The default is CURLUSESSL_NONE. so if you don't say anything, it's not attempting SSL. πŸŽ€

πŸ¦‹ PROTOCOLS πŸ¦‹

the protocol squad is FTP, SMTP, POP3, IMAP. periodt. 🫢

πŸ’… EXAMPLE πŸ’…

okay so here's the exact example, bestie β€” code is code:

CURL *curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/dir/file.ext");

  /* require use of SSL for this, or fail */
  curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL);

  /* Perform the request */
  curl_easy_perform(curl);
}

🌈 AVAILABILITY 🌈

Added in 7.11.0. This option was known as CURLOPT_FTP_SSL up to 7.16.4, and the constants were known as CURLFTPSSL_*. history lesson, slay. πŸ‘‘

⭐ RETURN VALUE ⭐

Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. that's the vibe check, fr fr. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

go peek at these icons:

okay bye bestie β€” this page came from libcurl 7.37.0, dated 19 Jun 2014, and it's GNURLOPT_USE_SSL(3) signing off. mwah πŸ’‹πŸ«Ά

πŸ“¦ where this page comes from