CURLOPT_USE_SSL(3)
π CURLOPT_USE_SSL(3) β like, the curl library functions manual, bestie π
okay so bestie, welcome to the CURLOPT_USE_SSL page, straight out of the curl Library Functions Manual β¨ this one is literally about telling libcurl "hey, can we do this transfer with SSL / TLS please?" π¦
β¨ NAME β¨
CURLOPT_USE_SSL β request using SSL / TLS for the transfer π
πΈ SYNOPSIS πΈ
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_USE_SSL, long level);
π DESCRIPTION π
So what you do is you pass a long using one of the values from down below β¬οΈ and that's how you make libcurl use your desired level of SSL for the transfer. main character energy tbh π
these are all protocols that start out plain text and get "upgraded" to SSL using the STARTTLS command. glow-up via negotiation, iconic π
this is for enabling SSL/TLS when you use FTP, SMTP, POP3, IMAP etc. iykyk π
CURLUSESSL_NONEβ do not attempt to use SSL. zero SSL, not even a little bit πCURLUSESSL_TRYβ try using SSL, proceed as normal otherwise. but bestie, heads up: the server may close the connection if the negotiation fails ππCURLUSESSL_CONTROLβ require SSL for the control connection, or fail withCURLE_USE_SSL_FAILED. no SSL on that control connection? we're not doing it, periodt π₯CURLUSESSL_ALLβ require SSL for all communication, or fail withCURLE_USE_SSL_FAILED. every single bit of the convo is encrypted or we simply don't go πβ¨
π DEFAULT π
CURLUSESSL_NONE
(the default is literally "no SSL", so yeah, you gotta ask for it fr fr π)
π¦ PROTOCOLS π¦
this functionality affects ftp, imap, pop3 and smtp πΈ
β EXAMPLE β
int main(void)
{
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);
}
}
see how it's giving "require use of SSL for this, or fail"? that's CURLUSESSL_ALL doing its thing π
π HISTORY π
- this option was known as
CURLOPT_FTP_SSLup to7.16.4π°οΈ - supported by LDAP since
7.81.0 - fully supported by the OpenLDAP backend only (so, like, know your backend bestie π«Ά)
CURLUSESSL_*enums becamelongtypes in8.13.0β prior to this version alongcast was necessary when passed tocurl_easy_setopt(3)π
π AVAILABILITY π
Added in curl 7.17.0 β¨
π 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 π
and that's the whole page bestie, go forth and negotiate your TLS π§π
later babes β this was libcurl, dated 2026-10-12, mwah π
π¦ 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