CURLOPT_PROXY_KEYPASSWD(3)
π CURLOPT_PROXY_KEYPASSWD(3)
okay bestie, welcome to another iconic page from the libcurl Library Functions Manual β¨ this one is about CURLOPT_PROXY_KEYPASSWD, and it's lowkey a lifesaver the moment you're doing proxy TLS stuff. sit with me, we've got this π«Ά
πΈ NAME
CURLOPT_PROXY_KEYPASSWD β the passphrase for your proxy's private key π
β¨ SYNOPSIS
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_KEYPASSWD, char *pwd);
π DESCRIPTION
okay so first things first, the vibe check: this option is for connecting to an HTTPS proxy, not an HTTPS server. literally different thing, don't mix them up π
You pass a pointer to a null-terminated string as the parameter. That string is used as the password required to use the CURLOPT_PROXY_SSLKEY(3) private key. And here's the tea bestie: you never need a passphrase to load a certificate, but you do need one to load your private key. that's just how it is π
The application does not have to keep the string around after setting this option β so you can let it go, she's free, main character energy π
Use this option multiple times and it's giving "last one wins" β the last set string overrides 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. so basically the whole secure squad π
This option works only with the following TLS backends: OpenSSL, Schannel, mbedTLS and wolfSSL. no cap, that's the list.
β EXAMPLE
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy.example:443");
curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "superman");
result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
}
the way this snippet just works π "superman" as the passphrase is such an icon, honestly.
π§ AVAILABILITY
Added in curl 7.52.0 β vintage but still slaying π«
π₯ RETURN VALUE
curl_easy_setopt(3) returns a CURLcode indicating success or error. CURLE_OK (0) means everything was OK, and non-zero means an error occurred β see libcurl-errors(3) for the whole lineup π
π SEE ALSO
aaaaand that's the page, bestie π
mwah π this was libcurl, dated 2026-10-12, and yes she's still CURLOPT_PROXY_KEYPASSWD(3) at heart. go forth and passphrase 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