CURLOPT_PROXY_SSLKEY_BLOB(3)
π CURLOPT_PROXY_SSLKEY_BLOB(3) π
okay bestie, welcome to the libcurl corner of the Library Functions Manual β this one's about CURLOPT_PROXY_SSLKEY_BLOB, and yes the header up top is doing that shy CURLOPT_PR...SSLKEY_BLOB(3) thing because the name is lowkey a mouthful. anyway. let's get into it π
β¨ NAME β¨
CURLOPT_PROXY_SSLKEY_BLOB β the private key for your proxy cert, but likeβ¦ straight from a memory blob π§ π
β¨ SYNOPSIS β¨
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSLKEY_BLOB,
struct curl_blob *blob);
β¨ DESCRIPTION β¨
so basically you pass a pointer to a curl_blob struct that holds the info (the pointer and the size) about the private key you need for connecting to the HTTPS proxy. it's compatible with OpenSSL π¦. and the format (like "PEM") has to be specified with CURLOPT_PROXY_SSLKEYTYPE(3) β no guessing, bestie, you gotta say it π
if the blob is initialized with the flags member of struct curl_blob set to CURL_BLOB_COPY, then the application does not have to keep the buffer around after setting this. so curl copies it for you and you can go live your life π«Ά β iconic behavior honestly.
β¨ DEFAULT β¨
NULL
β¨ PROTOCOLS β¨
this functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. the whole squad π
heads up: this option works only with the following TLS backends: OpenSSL. that's the whole list. one (1) backend. no cap π
β¨ EXAMPLE β¨
extern char *certificateData; /* point to data */
extern size_t filesize; /* size of data */
extern char *privateKeyData; /* point to data */
extern size_t privateKeySize; /* size */
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
struct curl_blob blob;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example");
blob.data = certificateData;
blob.len = filesize;
blob.flags = CURL_BLOB_COPY;
curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT_BLOB, &blob);
curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERTTYPE, "PEM");
blob.data = privateKeyData;
blob.len = privateKeySize;
curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY_BLOB, &blob);
curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "s3cret");
result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
}
look at that. cert blob, key blob, password "s3cret" β she's got the whole fit on π₯
β¨ AVAILABILITY β¨
added in curl 7.71.0 β (yes she's a relatively recent queen)
β¨ 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 β go check libcurl-errors(3) and it'll tell you what's up π
β¨ SEE ALSO β¨
and that's the whole vibe check, bestie οΏ½. this page came to you from libcurl, dated 2026-10-12, filed under CURLOPT_PR...SSLKEY_BLOB(3) β go forth and blob your proxy keys responsibly πβ¨π
π¦ 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