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