CURLOPT_SSLENGINE(3)

okay bestie, welcome to CURLOPT_SSLENGINE(3) from the libcurl manual β€” yes, the Library Functions Manual corner of the group chat. This page is all about setting your SSL engine or provider, and it’s honestly less scary than it sounds. 🫢✨

✨ NAME ✨

CURLOPT_SSLENGINE β€” Set SSL engine or provider

🌸 SYNOPSIS 🌸

#include <curl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSLENGINE, char *id);

πŸ’… DESCRIPTION πŸ’…

Okay so you pass a pointer to a null-terminated string as the parameter. That string is used as the identifier for the engine or provider you want to use for your private key. OpenSSL 1 had engines, OpenSSL 3 has providers. No cap. πŸ”₯

The application does not have to keep the string around after setting this option. So you can let it go, bestie β€” libcurl is not asking you to hold onto it. πŸ’œ

When asking libcurl to use a provider, the application can also optionally provide a property β€” a set of name value pairs. Such a property can be specified separated from the name with a colon (:). iykyk. πŸ¦‹

Using this option multiple times makes the last set string override the previous ones. Set it to NULL to disable its use again. Periodt. πŸ’…

πŸŽ€ DEFAULT πŸŽ€

NULL

πŸ¦‹ PROTOCOLS πŸ¦‹

This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.

This option works only with the following TLS backends: OpenSSL.

🌈 EXAMPLE 🌈

Here’s the example β€” yes, it’s serving main character energy:

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");
    result = curl_easy_perform(curl);
    curl_easy_cleanup(curl);
  }
}

πŸ‘‘ AVAILABILITY πŸ‘‘

Added in curl 7.9.3.

πŸ’– RETURN VALUE πŸ’–

  • CURLE_OK β€” Engine found.
  • CURLE_SSL_ENGINE_NOTFOUND β€” Engine not found, or OpenSSL was not built with engine support.
  • CURLE_SSL_ENGINE_INITFAILED β€” Engine found but initialization failed.
  • CURLE_NOT_BUILT_IN β€” Option not built in, OpenSSL is not the SSL backend.
  • CURLE_UNKNOWN_OPTION β€” Option not recognized.
  • CURLE_OUT_OF_MEMORY β€” Insufficient heap space.

⭐ SEE ALSO ⭐


mwah πŸ’‹ and that’s the whole vibe. This page is from the libcurl manual, source/version libcurl, dated 2026-10-12. Bye bestie, slay your TLS setup! πŸ§šβ€β™€οΈπŸ’œ

πŸ“¦ where this page comes from