1---
2c: Copyright (C) Daniel Stenberg, <daniel.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_PROXY_ISSUERCERT
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_ISSUERCERT (3)
9  - CURLOPT_PROXY_SSL_VERIFYHOST (3)
10  - CURLOPT_PROXY_SSL_VERIFYPEER (3)
11  - CURLOPT_SSL_VERIFYHOST (3)
12  - CURLOPT_SSL_VERIFYPEER (3)
13---
14
15# NAME
16
17CURLOPT_PROXY_ISSUERCERT - proxy issuer SSL certificate filename
18
19# SYNOPSIS
20
21~~~c
22#include <curl/curl.h>
23
24CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_ISSUERCERT, char *file);
25~~~
26
27# DESCRIPTION
28
29Pass a char pointer to a null-terminated string naming a *file* holding a CA
30certificate in PEM format. If the option is set, an additional check against
31the peer certificate is performed to verify the issuer of the HTTPS proxy is
32indeed the one associated with the certificate provided by the option. This
33additional check is useful in multi-level PKI where one needs to enforce that
34the peer certificate is from a specific branch of the tree.
35
36This option makes sense only when used in combination with the
37CURLOPT_PROXY_SSL_VERIFYPEER(3) option. Otherwise, the result of the
38check is not considered as failure.
39
40A specific error code (CURLE_SSL_ISSUER_ERROR) is defined with the option,
41which is returned if the setup of the SSL/TLS session has failed due to a
42mismatch with the issuer of peer certificate
43(CURLOPT_PROXY_SSL_VERIFYPEER(3) has to be set too for the check to
44fail).
45
46The application does not have to keep the string around after setting this
47option.
48
49# DEFAULT
50
51NULL
52
53# PROTOCOLS
54
55All TLS-based protocols
56
57# EXAMPLE
58
59~~~c
60int main(void)
61{
62  CURL *curl = curl_easy_init();
63  if(curl) {
64    CURLcode res;
65    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
66    /* using an HTTPS proxy */
67    curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:443");
68    curl_easy_setopt(curl, CURLOPT_PROXY_ISSUERCERT, "/etc/certs/cacert.pem");
69    res = curl_easy_perform(curl);
70    curl_easy_cleanup(curl);
71  }
72}
73~~~
74
75# AVAILABILITY
76
77Added in 7.71.0. This option is supported by the OpenSSL backends.
78
79# RETURN VALUE
80
81Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
82CURLE_OUT_OF_MEMORY if there was insufficient heap space.
83