GNURLOPT_SSLKEYTYPE(3)
π GNURLOPT_SSLKEYTYPE(3) π
okay bestie, this is the GNURLOPT_SSLKEYTYPE(3) page, hanging out in the curl_easy_setopt options manual section β and it's here to explain setting the type of your private key file. no cap. β¨
πΈ NAME πΈ
CURLOPT_SSLKEYTYPE β set type of the private key file π
π SYNOPSIS π
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSLKEYTYPE, char *type);
π¦ DESCRIPTION π¦
You pass a pointer to a null-terminated string as parameter β that string is, like, the format of your private key. Supported formats are "PEM", "DER" and "ENG". π
The format "ENG" enables you to load the private key from a crypto engine. In this case CURLOPT_SSLKEY(3) is used as an identifier passed to the engine. You have to set the crypto engine with CURLOPT_SSLENGINE(3). π§
The "DER" format key file currently does not work because of a bug in OpenSSL β not the vibe, but that's the tea. π
The application does not have to keep the string around after setting this option, so don't stress about keeping it alive afterward. π«Ά
β¨ DEFAULT β¨
"PEM" β that's the default, periodt. π
π PROTOCOLS π
All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. π
π₯ EXAMPLE π₯
like, here's the whole vibe:
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
curl_easy_setopt(curl, CURLOPT_SSLCERT, "client.pem");
curl_easy_setopt(curl, CURLOPT_SSLKEY, "key.pem");
curl_easy_setopt(curl, CURLOPT_SSLKEYTYPE, "PEM");
curl_easy_setopt(curl, CURLOPT_KEYPASSWD, "s3cret");
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
π§ AVAILABILITY π§
Available if built TLS enabled β that's the condition, bestie. β¨
π 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. π«Ά
π SEE ALSO π
CURLOPT_SSLKEY(3), CURLOPT_SSLCERT(3),β go peek at these too, bestie π
mwah π β this page is from libcurl 7.37.0, dated 17 Jun 2014, and it's still the GNURLOPT_SSLKEYTYPE(3) manual page. byeee bestie π«Άβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms