GNURLOPT_PROXY_SSLCERT_BLOB(3)

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

πŸŽ€ GNURLOPT_PROXY_SSLCERT_BLOB(3) πŸŽ€

okay bestie, welcome to the GNURLOPT_PROXY_SSLCERT_BLOB(3) page from the curl_easy_setopt options manual. this one is all about handing curl a proxy client certificate that lives in memory instead of on disk. no cap.

πŸ’– NAME πŸ’–

CURLOPT_PROXY_SSLCERT_BLOB β€” SSL proxy client certificate from memory blob. literally what it says on the tin, bestie.

✨ SYNOPSIS ✨

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSLCERT_BLOB,
struct curl_blob *blob);

πŸ¦‹ DESCRIPTION πŸ¦‹

So you pass a pointer to a curl_blob structure, and that structure contains information β€” specifically the pointer and size β€” about a memory block with binary data of the certificate used to connect to the HTTPS proxy. very memory blob, very demure.

Now for the format tea:

  • On Secure Transport or Schannel, the format must be "P12".
  • On OpenSSL, the format must be "P12" or "PEM".

The string "P12" or "PEM" must be specified with CURLOPT_PROXY_SSLCERTTYPE(3). do not skip that part, bestie.

If the blob is initialized with the flags member of struct curl_blob set to CURL_BLOB_COPY, the application does not have to keep the buffer around after setting this. iconic behavior, honestly.

This option is an alternative to CURLOPT_PROXY_SSLCERT(3) which instead expects a file name as input.

🌸 DEFAULT 🌸

NULL

πŸ¦‹ PROTOCOLS πŸ¦‹

All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.

πŸ”₯ EXAMPLE πŸ”₯

CURL *curl = curl_easy_init();
if(curl) {
  struct curl_blob blob;
  blob.data = certificateData;
  blob.len = filesize;
  blob.flags = CURL_BLOB_COPY;
  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy");
  curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY, "key.pem");
  curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "s3cret");
  curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT_BLOB, &blob);
  ret = curl_easy_perform(curl);
  curl_easy_cleanup(curl);
}

⭐ AVAILABILITY ⭐

Added in libcurl 7.71.0. This option is supported by the OpenSSL, Secure Transport and Schannel backends.

πŸ’… RETURN VALUE πŸ’…

Returns CURLE_OK if TLS enabled, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space.

🫢 SEE ALSO 🫢


and that’s the tea, bestie: this page is from libcurl 7.71.0, dated 24 Jun 2020, with footer title GNURLOPT_P...SLCERT_BLOB(3). mwah πŸ’‹
πŸ“¦ where this page comes from