1CURLOPT_ISSUERCERT(3)      curl_easy_setopt options      CURLOPT_ISSUERCERT(3)
2
3
4

NAME

6       CURLOPT_ISSUERCERT - issuer SSL certificate filename
7

SYNOPSIS

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

DESCRIPTION

15       Pass a char * to a null-terminated string naming a file  holding  a  CA
16       certificate  in  PEM  format. If the option is set, an additional check
17       against the peer certificate is performed to verify the issuer  is  in‐
18       deed  the  one  associated with the certificate provided by the option.
19       This additional check is useful in multi-level PKI where one  needs  to
20       enforce  that  the  peer  certificate  is from a specific branch of the
21       tree.
22
23       This option makes sense only when used in  combination  with  the  CUR‐
24       LOPT_SSL_VERIFYPEER(3)  option.  Otherwise,  the result of the check is
25       not considered as failure.
26
27       A specific error code (CURLE_SSL_ISSUER_ERROR) is defined with the  op‐
28       tion,  which is returned if the setup of the SSL/TLS session has failed
29       due to a mismatch with the issuer of peer certificate (CURLOPT_SSL_VER‐
30       IFYPEER(3) has to be set too for the check to fail). (Added in 7.19.0)
31
32       The  application  does not have to keep the string around after setting
33       this option.
34

DEFAULT

36       NULL
37

PROTOCOLS

39       All TLS-based protocols
40

EXAMPLE

42       CURL *curl = curl_easy_init();
43       if(curl) {
44         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
45         curl_easy_setopt(curl, CURLOPT_ISSUERCERT, "/etc/certs/cacert.pem");
46         ret = curl_easy_perform(curl);
47         curl_easy_cleanup(curl);
48       }
49

AVAILABILITY

51       If built TLS enabled
52

RETURN VALUE

54       Returns CURLE_OK if the option is  supported,  CURLE_UNKNOWN_OPTION  if
55       not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space.
56

SEE ALSO

58       CURLOPT_CRLFILE(3), CURLOPT_SSL_VERIFYPEER(3),
59
60
61
62libcurl 7.76.1                 November 04, 2020         CURLOPT_ISSUERCERT(3)
Impressum