GNURLOPT_P...SLCERTTYPE(3)

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

πŸ’… GNURLOPT_P...SLCERTTYPE(3) β€” proxy cert type core πŸ’…

Okay bestie, quick vibe check: this page lives in the curl_easy_setopt options manual, section 3, and the main character is GNURLOPT_P...SLCERTTYPE(3). It's giving β€œtell curl what format my proxy client cert is in” energy, and honestly? We love a narrowly focused icon. πŸŽ€

🌸 NAME 🌸

CURLOPT_PROXY_SSLCERTTYPE β€” specify the type of the proxy client SSL certificate. Slay. ✨

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnurl/curl.h>

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

πŸŽ€ DESCRIPTION πŸŽ€

So you pass a pointer to a null-terminated string as the parameter, bestie. That string should be the format of your client certificate used when connecting to an HTTPS proxy. Literally that's the whole assignment. πŸ’–

The supported formats are "PEM" and "DER", except with Secure Transport. OpenSSL (versions 0.9.3 and later) and Secure Transport (on iOS 5 or later, or OS X 10.7 or later) also support "P12" for PKCS#12-encoded files. Not me knowing the exact version lore β€” it's in the text, periodt. πŸ“šβœ¨

And good news: the application does not have to keep the string around after setting this option. Set it, forget it, live your life. 🫢

πŸ“ DEFAULT πŸ“

The default is "PEM" β€” iconic, classic, default behavior. πŸ’…

🌈 PROTOCOLS 🌈

All β€” no protocol gatekeeping here. All of them. 🌍✨

πŸ”₯ EXAMPLE πŸ”₯

CURL *curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy");
  curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT, "client.pem");
  curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERTTYPE, "PEM");
  curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY, "key.pem");
  curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "s3cret");
  ret = curl_easy_perform(curl);
  curl_easy_cleanup(curl);
}

Obsessed with a complete little setup block. The way it just sets the URL, proxy, cert, cert type, key, key password, performs, and cleans up? Highkey tidy. ✨🧚

⭐ AVAILABILITY ⭐

  • Added in 7.52.0. ⏳
  • If built TLS enabled. β€” so yeah, TLS build check matters, bestie.

πŸ’œ RETURN VALUE πŸ’œ

  • Returns CURLE_OK if TLS is supported.
  • Returns CURLE_UNKNOWN_OPTION if not.
  • Returns CURLE_OUT_OF_MEMORY if there was insufficient heap space. 😭

πŸ‘‘ SEE ALSO πŸ‘‘


okay bestie, that's the whole page β€” this one's from libcurl 7.52.0, dated 16 Nov 2016, and it's filed under GNURLOPT_P...SLCERTTYPE(3). Bye, love u, go set your proxy cert type correctly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from