CURLOPT_PROXY_SSLKEYTYPE(3)

πŸ’… CURLOPT_PROXY_SSLKEYTYPE(3) β€” type of the proxy private key file

okay so bestie, welcome to the Library Functions Manual β€” this is the CURLOPT_PROXY_SSLKEYTYPE(3) page, and it’s literally about telling curl what format your proxy private key file is in. no cap, it’s a tiny page but it has main character energy. βœ¨πŸŽ€

🌸 NAME 🌸

  • CURLOPT_PROXY_SSLKEYTYPE β€” type of the proxy private key file

✨ SYNOPSIS ✨

       #include <curl/curl.h>

       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSLKEYTYPE, char *type);

πŸ¦‹ DESCRIPTION πŸ¦‹

quick vibe check: this option is for connecting to an HTTPS proxy, not an HTTPS server. periodt. πŸ’…

you pass a pointer to a null-terminated string as the parameter. that string should be the format of your private key. the supported formats are "PEM", "DER", "ENG" and "PROV" (the last one was added in curl 8.12.0). πŸŽ€

good news: your application does not have to keep the string around after setting this option. 🫢

also, if you use this option multiple times, the last set string overrides the previous ones. set it to NULL to disable its use again. πŸ’–

🌈 PROTOCOLS 🌈

this functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. β€” it’s giving β€œall the TLS girlies.” ✨

vibe check on backends: this option works only with the following TLS backends: OpenSSL and wolfSSL.

πŸ”₯ EXAMPLE πŸ”₯

       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_PROXY, "https://proxy.example");
           curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT, "client.pem");
           curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY, "key.pem");
           curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEYTYPE, "PEM");
           curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "s3cret");
           result = curl_easy_perform(curl);
           curl_easy_cleanup(curl);
         }
       }

πŸ‘‘ AVAILABILITY πŸ‘‘

added in curl 7.52.0 β€” iconic. πŸ’œ

⭐ 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, so go see libcurl-errors(3). 😭

🫢 SEE ALSO 🫢


mwah πŸ’– that’s the whole CURLOPT_PROXY_SSLKEYTYPE(3) page from the libcurl manual, dated 2026-10-12 β€” slay, bestie, and happy proxying! βœ¨πŸŽ€

πŸ“¦ where this page comes from