1---
2c: Copyright (C) Daniel Stenberg, <daniel.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_PROXY_CAINFO_BLOB
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_CAINFO (3)
9  - CURLOPT_CAINFO_BLOB (3)
10  - CURLOPT_CAPATH (3)
11  - CURLOPT_PROXY_CAINFO (3)
12  - CURLOPT_PROXY_CAPATH (3)
13  - CURLOPT_PROXY_SSL_VERIFYHOST (3)
14  - CURLOPT_PROXY_SSL_VERIFYPEER (3)
15  - CURLOPT_SSL_VERIFYHOST (3)
16  - CURLOPT_SSL_VERIFYPEER (3)
17---
18
19# NAME
20
21CURLOPT_PROXY_CAINFO_BLOB - proxy Certificate Authority (CA) bundle in PEM format
22
23# SYNOPSIS
24
25~~~c
26#include <curl/curl.h>
27
28CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_CAINFO_BLOB,
29                          struct curl_blob *stblob);
30~~~
31
32# DESCRIPTION
33
34This option is for connecting to an HTTPS proxy, not an HTTPS server.
35
36Pass a pointer to a curl_blob structure, which contains information (pointer
37and size) about a memory block with binary data of PEM encoded content holding
38one or more certificates to verify the HTTPS proxy with.
39
40If the blob is initialized with the flags member of struct curl_blob set to
41CURL_BLOB_COPY, the application does not have to keep the buffer around after
42setting this.
43
44If CURLOPT_PROXY_SSL_VERIFYPEER(3) is zero and you avoid verifying the
45server's certificate, CURLOPT_PROXY_CAINFO_BLOB(3) is not needed.
46
47This option overrides CURLOPT_PROXY_CAINFO(3).
48
49# DEFAULT
50
51NULL
52
53# PROTOCOLS
54
55Used with HTTPS proxy
56
57# EXAMPLE
58
59~~~c
60#include <string.h> /* for strlen */
61
62extern char *strpem; /* strpem must point to a PEM string */
63int main(void)
64{
65  CURL *curl = curl_easy_init();
66  if(curl) {
67    CURLcode res;
68    struct curl_blob blob;
69    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
70    /* using an HTTPS proxy */
71    curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:443");
72    blob.data = strpem;
73    blob.len = strlen(strpem);
74    blob.flags = CURL_BLOB_COPY;
75    curl_easy_setopt(curl, CURLOPT_PROXY_CAINFO_BLOB, &blob);
76    res = curl_easy_perform(curl);
77    curl_easy_cleanup(curl);
78  }
79}
80~~~
81
82# AVAILABILITY
83
84Added in 7.77.0.
85
86This option is supported by the rustls (since 7.82.0), OpenSSL, Secure
87Transport and Schannel backends.
88
89# RETURN VALUE
90
91Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
92CURLE_OUT_OF_MEMORY if there was insufficient heap space.
93