1---
2c: Copyright (C) Daniel Stenberg, <daniel.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_PROXY_CAPATH
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_CAINFO (3)
9  - CURLOPT_DEBUGFUNCTION (3)
10  - CURLOPT_PROXY_CAINFO (3)
11  - CURLOPT_PROXY_SSL_VERIFYHOST (3)
12  - CURLOPT_STDERR (3)
13---
14
15# NAME
16
17CURLOPT_PROXY_CAPATH - directory holding HTTPS proxy CA certificates
18
19# SYNOPSIS
20
21~~~c
22#include <curl/curl.h>
23
24CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_CAPATH, char *capath);
25~~~
26
27# DESCRIPTION
28
29Pass a char pointer to a null-terminated string naming a directory holding
30multiple CA certificates to verify the HTTPS proxy with. If libcurl is built
31against OpenSSL, the certificate directory must be prepared using the OpenSSL
32**c_rehash** utility. This makes sense only when
33CURLOPT_PROXY_SSL_VERIFYPEER(3) is enabled (which it is by default).
34
35The application does not have to keep the string around after setting this
36option.
37
38The default value for this can be figured out with CURLINFO_CAPATH(3).
39
40# DEFAULT
41
42NULL
43
44# PROTOCOLS
45
46Everything used over an HTTPS proxy
47
48# EXAMPLE
49
50~~~c
51int main(void)
52{
53  CURL *curl = curl_easy_init();
54  if(curl) {
55    CURLcode res;
56    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
57    /* using an HTTPS proxy */
58    curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:443");
59    curl_easy_setopt(curl, CURLOPT_PROXY_CAPATH, "/etc/cert-dir");
60    res = curl_easy_perform(curl);
61    curl_easy_cleanup(curl);
62  }
63}
64~~~
65
66# AVAILABILITY
67
68Added in 7.52.0
69
70This option is supported by the OpenSSL, GnuTLS, and mbedTLS (since 7.56.0)
71backends.
72
73# RETURN VALUE
74
75CURLE_OK if supported; or an error such as:
76
77CURLE_NOT_BUILT_IN - Not supported by the SSL backend
78
79CURLE_UNKNOWN_OPTION
80
81CURLE_OUT_OF_MEMORY
82