CURLOPT_SSLENGINE_DEFAULT(3)

✨ CURLOPT_SSLENGINE_DEFAULT β€” make SSL engine default ✨

okay bestie, so this little cutie lives in the libcurl family of manual pages (libcurl, Library Functions Manual, if we're being official about it πŸŽ€) and honestly? it's giving "small but mighty." let me tell you everything πŸ’…


✨ SYNOPSIS ✨

#include <curl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSLENGINE_DEFAULT, long val);

like, that's the whole vibe. one curl_easy_setopt call, CURL *handle, a long val, and we're done 🫢


🌸 DESCRIPTION 🌸

so you pass a long set to 1 and that makes the already-specified crypto engine the default for (asymmetric) crypto operations. that's it. that's the whole job. main character energy but make it one line πŸ”₯

ngl, this option has no effect unless you set it after CURLOPT_SSLENGINE(3). literally. it does nothing on its own β€” it's a sequel, not a standalone. 😭

πŸ¦‹ DEFAULT πŸ¦‹

None β€” yeah, nothing. no default behavior, no secret fallback. you gotta actually ask for it, iykyk πŸ™ˆ


πŸ’œ PROTOCOLS πŸ’œ

this functionality affects all TLS based protocols, and when I say all I mean it:

  • HTTPS
  • FTPS
  • IMAPS
  • POP3S
  • SMTPS
  • etc. (you get the picture ✨)
okay important vibe check though: this option works only with the following TLS backends: OpenSSL. so if you're on anything else, it's not gonna slay for you πŸ’€

🌈 EXAMPLE 🌈

here's the whole little program, copy it exactly bestie, don't freestyle it:

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_SSLENGINE, "dynamic");
    curl_easy_setopt(curl, CURLOPT_SSLENGINE_DEFAULT, 1L);
    result = curl_easy_perform(curl);
    curl_easy_cleanup(curl);
  }
}

see how CURLOPT_SSLENGINE comes first and CURLOPT_SSLENGINE_DEFAULT comes after? that's the order, periodt πŸ‘‘


⭐ AVAILABILITY ⭐

added in curl 7.9.3 β€” an absolute icon from back in the day, still serving πŸ’–


πŸ”₯ RETURN VALUE πŸ”₯

here's the full rundown of what you can get back, no cap:

  • CURLE_OK β€” Engine set as default. slay, it worked πŸ’…
  • CURLE_SSL_ENGINE_SETFAILED β€” Engine could not be set as default. the engine said no 😭
  • CURLE_NOT_BUILT_IN β€” Option not built in, OpenSSL is not the SSL backend. wrong backend, wrong timeline πŸ’€
  • CURLE_UNKNOWN_OPTION β€” Option not recognized. doesn't know her 🫠
  • CURLE_OUT_OF_MEMORY β€” Insufficient heap space. the heap is full, she's going through it πŸ™ˆ

🌸 SEE ALSO 🌸

go read those too, they're literally the prequels πŸ¦‹


and that's the whole page, bestie! this came straight from the libcurl manual, dated 2026-10-12 β€” yeah, she's got a timestamp and everything πŸ‘‘ take care of her, set your engine first, and remember: CURLOPT_SSLENGINE_DEFAULT is nothing without CURLOPT_SSLENGINE. tandem ride fr fr πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from