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