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

NAME

6       CURLOPT_CAINFO_BLOB - Certificate Authority (CA) bundle in PEM format
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CAINFO_BLOB,
12                                 struct curl_blob *stblob);
13

DESCRIPTION

15       Pass  a  pointer  to  a curl_blob structure, which contains information
16       (pointer and size) about a memory block with binary data of PEM encoded
17       content  holding  one  or  more certificates to verify the HTTPS server
18       with.
19
20       If CURLOPT_SSL_VERIFYPEER(3)  is  zero  and  you  avoid  verifying  the
21       server's certificate, CURLOPT_CAINFO_BLOB(3) is not needed.
22
23       This option overrides CURLOPT_CAINFO(3).
24

DEFAULT

26       NULL
27

PROTOCOLS

29       All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
30

EXAMPLE

32       char *strpem; /* strpem must point to a PEM string */
33       CURL *curl = curl_easy_init();
34       if(curl) {
35         struct curl_blob blob;
36         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
37         blob.data = strpem;
38         blob.len = strlen(strpem);
39         blob.flags = CURL_BLOB_COPY;
40         curl_easy_setopt(curl, CURLOPT_CAINFO_BLOB, &blob);
41         ret = curl_easy_perform(curl);
42         curl_easy_cleanup(curl);
43       }
44

AVAILABILITY

46       Added in 7.77.0.
47
48       This  option is supported by the BearSSL (since 7.79.0), mbedTLS (since
49       7.81.0), rustls (since 7.82.0), OpenSSL, Secure Transport and  Schannel
50       backends.
51

RETURN VALUE

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

SEE ALSO

57       CURLOPT_CAINFO(3), CURLOPT_CAPATH(3),  CURLOPT_SSL_VERIFYPEER(3),  CUR‐
58       LOPT_SSL_VERIFYHOST(3),
59
60
61
62libcurl 7.85.0                   May 17, 2022           CURLOPT_CAINFO_BLOB(3)
Impressum