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,  struct
12       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), OpenSSL, Secure
49       Transport and Schannel backends.
50

RETURN VALUE

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

SEE ALSO

56       CURLOPT_CAINFO(3), CURLOPT_CAPATH(3),  CURLOPT_SSL_VERIFYPEER(3),  CUR‐
57       LOPT_SSL_VERIFYHOST(3),
58
59
60
61libcurl 7.79.1                   July 21, 2021          CURLOPT_CAINFO_BLOB(3)
Impressum