GNURLOPT_PROXY_ISSUERCERT(3)
Okay so bestie, this is the GNURLOPT_P..._ISSUERCERT(3) page from the curl_easy_setopt options manual β and it's giving βmake sure your HTTPS proxy's issuer cert is exactly who you think it is.β No cap. π
π NAME π
CURLOPT_PROXY_ISSUERCERTβ proxy issuer SSL certificate filename π
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_ISSUERCERT, char
*file);
π DESCRIPTION π
Pass a char * to a null-terminated string that names a file holding a CA certificate in PEM format. Once this option is set, there's an extra check against the peer certificate: it verifies that the issuer of the HTTPS proxy is actually the one associated with the certificate you provided in the option. This extra check is lowkey iconic in multi-level PKI, where you need to enforce that the peer certificate comes from a specific branch of the tree. π³
β οΈ Vibe check: this option only makes sense when used together with the CURLOPT_PROXY_SSL_VERIFYPEER(3) option. Otherwise, the result of the check is not considered a failure. Periodt.
There's a specific error code, CURLE_SSL_ISSUER_ERROR, defined with this option. It gets returned if setting up the SSL/TLS session failed because of a mismatch with the issuer of the peer certificate β and yes, CURLOPT_PROXY_SSL_VERIFYPEER(3) has to be set too for the check to fail. π
The application does not have to keep the string around after setting this option. Set it and let it go, bestie. π¦
π¦ DEFAULT π¦
NULL
π PROTOCOLS π
All TLS-based protocols β¨
π EXAMPLE π
Here's the whole scenario β HTTPS proxy, custom issuer cert file, all the good stuff:
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
/* using an HTTPS proxy */
curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:443");
curl_easy_setopt(curl, CURLOPT_PROXY_ISSUERCERT, "/etc/certs/cacert.pem");
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
β AVAILABILITY β
Added in libcurl 7.71.0. This option is supported by the OpenSSL backends.
π RETURN VALUE π
Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. π«Ά
π SEE ALSO π
CURLOPT_PROXY_SSL_VERIFYPEER(3)CURLOPT_PROXY_SSL_VERIFYHOST(3)CURLOPT_SSL_VERIFYPEER(3)CURLOPT_SSL_VERIFYHOST(3)
This page is from libcurl 7.71.0, dated 24 Jun 2020, and it's the GNURLOPT_P..._ISSUERCERT(3) page. Bye bestie β go make those issuers verified! πβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms