GNURLOPT_PROXY_KEYPASSWD(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ’… GNURLOPT_PROXY_KEYPASSWD(3) β€” like, the whole curl_easy_setopt options situation πŸŽ€

okay bestie, so this page lives in the curl_easy_setopt options family of the manual β€” that's the vibe check for where you found it β€” and it's all about GNURLOPT_PROXY_KEYPASSWD. yes the file name is long. no we're not shortening it. iykyk. πŸ’–


✨ NAME ✨

CURLOPT_PROXY_KEYPASSWD β€” the one where you set the passphrase for your proxy's private key πŸ”‘


✨ SYNOPSIS ✨

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_KEYPASSWD, char
*pwd);

like, that's the whole incantation. copy it exactly, don't freestyle it 🫢


✨ DESCRIPTION ✨

okay so first things first, and this is the part people get wrong: this option is for connecting to an HTTPS proxy, not an HTTPS server. read that again. proxy. not server. they're different main characters 🌈

you pass a pointer to a null-terminated string as the parameter. that string gets used as the password required to use the CURLOPT_PROXY_SSLKEY(3) private key. basically, the way that loading a certificate never needed a pass phrase but loading your private key absolutely does? that's the whole point of this option πŸŽ€

good news though β€” the application does not have to keep the string around after setting this option. so you can yeet it once you've set it. slay πŸ’…


✨ DEFAULT ✨

NULL

(iconic. empty. nothing. the void πŸ‘‘)


✨ PROTOCOLS ✨

Used with HTTPS proxy. that's it, that's the whole list πŸ¦‹


✨ EXAMPLE ✨

CURL *curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
  curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy:443");
  curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "superman");
  ret = curl_easy_perform(curl);
  curl_easy_cleanup(curl);
}

not the password being "superman" 😭 bestie please pick something stronger, but also, keep it verbatim, it's an example, not a security audit πŸ’€


✨ AVAILABILITY ✨

Added in 7.52.0. so if you're on something older, it's giving "not yet, babe" πŸ“


✨ RETURN VALUE ✨

  • CURLE_OK β€” if TLS is enabled. we love a happy ending πŸ’–
  • CURLE_UNKNOWN_OPTION β€” if TLS is not enabled. rude, but fair πŸ™ˆ
  • CURLE_OUT_OF_MEMORY β€” if there was insufficient heap space. your RAM said "no ma'am" 😭

✨ SEE ALSO ✨


⚠️ reminder bestie: HTTPS proxy, not HTTPS server. mixing those up is a whole vibe check failure and i will be texting you about it 🫢

okay that's the page!! written by the libcurl 7.52.0 girlies, dated 16 Nov 2016, filed under GNURLOPT_PROXY_KEYPASSWD(3) β€” mwah, go set your passphrase, you're doing amazing πŸ’œβœ¨

πŸ“¦ where this page comes from