1CURLOPT_ISSUERCERT(3) curl_easy_setopt options CURLOPT_ISSUERCERT(3)
2
3
4
6 CURLOPT_ISSUERCERT - issuer SSL certificate filename
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ISSUERCERT, char *file);
12
14 Pass a char * to a null-terminated string naming a file holding a CA
15 certificate in PEM format. If the option is set, an additional check
16 against the peer certificate is performed to verify the issuer is in‐
17 deed the one associated with the certificate provided by the option.
18 This additional check is useful in multi-level PKI where one needs to
19 enforce that the peer certificate is from a specific branch of the
20 tree.
21
22 This option makes sense only when used in combination with the CUR‐
23 LOPT_SSL_VERIFYPEER(3) option. Otherwise, the result of the check is
24 not considered as failure.
25
26 A specific error code (CURLE_SSL_ISSUER_ERROR) is defined with the op‐
27 tion, which is returned if the setup of the SSL/TLS session has failed
28 due to a mismatch with the issuer of peer certificate (CURLOPT_SSL_VER‐
29 IFYPEER(3) has to be set too for the check to fail). (Added in 7.19.0)
30
31 The application does not have to keep the string around after setting
32 this option.
33
35 NULL
36
38 All TLS-based protocols
39
41 CURL *curl = curl_easy_init();
42 if(curl) {
43 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
44 curl_easy_setopt(curl, CURLOPT_ISSUERCERT, "/etc/certs/cacert.pem");
45 ret = curl_easy_perform(curl);
46 curl_easy_cleanup(curl);
47 }
48
50 If built TLS enabled
51
53 Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if
54 not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space.
55
57 CURLOPT_CRLFILE(3), CURLOPT_SSL_VERIFYPEER(3),
58
59
60
61libcurl 7.85.0 May 17, 2022 CURLOPT_ISSUERCERT(3)