1CURLOPT_PROXY_CAINFO(3)             libcurl            CURLOPT_PROXY_CAINFO(3)
2
3
4

NAME

6       CURLOPT_PROXY_CAINFO - path to proxy Certificate Authority (CA) bundle
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_CAINFO, char *path);
12

DESCRIPTION

14       This option is for connecting to an HTTPS proxy, not an HTTPS server.
15
16       Pass  a char * to a null-terminated string naming a file holding one or
17       more certificates to verify the HTTPS proxy with.
18
19       If CURLOPT_PROXY_SSL_VERIFYPEER(3) is zero and you avoid verifying  the
20       server's certificate, CURLOPT_PROXY_CAINFO(3) need not even indicate an
21       accessible file.
22
23       This option is by default set to the system  path  where  libcurl's  CA
24       certificate  bundle  is  assumed  to be stored, as established at build
25       time.
26
27       If curl is built against the NSS SSL library, the NSS PEM PKCS#11  mod‐
28       ule  (libnsspem.so) needs to be available for this option to work prop‐
29       erly.
30
31       (iOS and macOS only) If curl is built against  Secure  Transport,  then
32       this  option is supported for backward compatibility with other SSL en‐
33       gines, but it should not be set. If the option is not  set,  then  curl
34       will use the certificates in the system and user Keychain to verify the
35       peer, which is the preferred method of verifying the peer's certificate
36       chain.
37
38       The  application  does not have to keep the string around after setting
39       this option.
40
41       The default value for this can be figured out with CURLINFO_CAINFO(3).
42

DEFAULT

44       Built-in system specific
45

PROTOCOLS

47       Used with HTTPS proxy
48

EXAMPLE

50       CURL *curl = curl_easy_init();
51       if(curl) {
52         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
53         /* using an HTTPS proxy */
54         curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:443");
55         curl_easy_setopt(curl, CURLOPT_PROXY_CAINFO, "/etc/certs/cabundle.pem");
56         ret = curl_easy_perform(curl);
57         curl_easy_cleanup(curl);
58       }
59

AVAILABILITY

61       Added in 7.52.0
62
63       For TLS backends that  do  not  support  certificate  files,  the  CUR‐
64       LOPT_PROXY_CAINFO(3)      option      is      ignored.     Refer     to
65       https://curl.se/docs/ssl-compared.html
66

RETURN VALUE

68       Returns CURLE_OK if the option is  supported,  CURLE_UNKNOWN_OPTION  if
69       not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space.
70

SEE ALSO

72       CURLOPT_PROXY_CAINFO_BLOB(3),       CURLOPT_PROXY_CAPATH(3),       CUR‐
73       LOPT_PROXY_SSL_VERIFYPEER(3),   CURLOPT_PROXY_SSL_VERIFYHOST(3),   CUR‐
74       LOPT_CAINFO(3),    CURLOPT_CAINFO_BLOB(3),    CURLOPT_CAPATH(3),   CUR‐
75       LOPT_SSL_VERIFYPEER(3), CURLOPT_SSL_VERIFYHOST(3),
76
77
78
79ibcurl 8.2.1                    April 26, 2023         CURLOPT_PROXY_CAINFO(3)
Impressum