GNURLOPT_PROXY_CAPATH(3)
π NAME π
CURLOPT_PROXY_CAPATH β specify directory holding proxy CA certificates.
Okay so the manual name is GNURLOPT_PROXY_CAPATH(3), and it lives in the curl_easy_setopt options lane, bestie. If you clicked in here looking for proxy CA cert directory behavior, you're exactly where you need to be π
.
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_CAPATH, char
*capath);
That's the whole signature, no cap.
π¦ DESCRIPTION π¦
okay so you pass a char * to a null-terminated string naming a directory holding multiple CA certificates to verify the HTTPS proxy with. It's giving "here is my whole certificate directory, please vibe check this proxy" energy.
If libcurl is built against OpenSSL, the certificate directory must be prepared using the openssl c_rehash utility. That is literally required for the OpenSSL build, iykyk.
vibe check: this makes sense only when CURLOPT_PROXY_SSL_VERIFYPEER(3) is enabled (which it is by default). So if verification is off, don't expect this directory path to do its main character thing.
Good news: the application does not have to keep the string around after setting this option. Set it, breathe, move on π«Ά.
π DEFAULT π
NULL β no directory is set by default.
π PROTOCOLS π
Everything used over an HTTPS proxy. That's the whole protocol mood.
π EXAMPLE π
Here's the little example, copied exactly because code is sacred:
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_CAPATH, "/etc/cert-dir");
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
π₯ AVAILABILITY π₯
Added in 7.52.0. Periodt.
This option is supported by the OpenSSL, GnuTLS, and mbedTLS (since 7.56.0) backends. The NSS backend provides the option only for backward compatibility. So NSS is lowkey just keeping the option around for old times' sake.
β RETURN VALUE β
CURLE_OK if supported; or an error such as:
CURLE_NOT_BUILT_INβ Not supported by the SSL backendCURLE_UNKNOWN_OPTIONCURLE_OUT_OF_MEMORY
π SEE ALSO π
CURLOPT_PROXY_CAINFO(3), CURLOPT_STDERR(3), CURLOPT_DEBUGFUNCTION(3)
xoxo, your Unix bestie π β GNURLOPT_PROXY_CAPATH(3) says byeee. Shipped in libcurl 7.52.0, dated 16 Nov 2016 π«Άβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2019, 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