1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_PROXY_SSLCERT_BLOB
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_PROXY_SSLCERT (3)
9  - CURLOPT_PROXY_SSLCERTTYPE (3)
10  - CURLOPT_PROXY_SSLKEY (3)
11  - CURLOPT_SSLCERT_BLOB (3)
12Protocol:
13  - TLS
14TLS-backend:
15  - OpenSSL
16  - Schannel
17  - Secure Transport
18---
19
20# NAME
21
22CURLOPT_PROXY_SSLCERT_BLOB - SSL proxy client certificate from memory blob
23
24# SYNOPSIS
25
26~~~c
27#include <curl/curl.h>
28
29CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSLCERT_BLOB,
30                          struct curl_blob *blob);
31~~~
32
33# DESCRIPTION
34
35Pass a pointer to a curl_blob structure, which contains information (pointer
36and size) about a memory block with binary data of the certificate used to
37connect to the HTTPS proxy. The format must be "P12" on Secure Transport or
38Schannel. The format must be "P12" or "PEM" on OpenSSL. The string "P12" or
39"PEM" must be specified with CURLOPT_PROXY_SSLCERTTYPE(3).
40
41If the blob is initialized with the flags member of struct curl_blob set to
42CURL_BLOB_COPY, the application does not have to keep the buffer around after
43setting this.
44
45This option is an alternative to CURLOPT_PROXY_SSLCERT(3) which instead
46expects a filename as input.
47
48# DEFAULT
49
50NULL
51
52# EXAMPLE
53
54~~~c
55
56extern char *certificateData; /* point to data */
57extern size_t filesize; /* size of the data */
58
59int main(void)
60{
61  CURL *curl = curl_easy_init();
62  if(curl) {
63    CURLcode res;
64    struct curl_blob blob;
65    blob.data = certificateData;
66    blob.len = filesize;
67    blob.flags = CURL_BLOB_COPY;
68    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
69    curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy");
70    curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY, "key.pem");
71    curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "s3cret");
72    curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT_BLOB, &blob);
73    res = curl_easy_perform(curl);
74    curl_easy_cleanup(curl);
75  }
76}
77~~~
78
79# AVAILABILITY
80
81Added in 7.71.0.
82
83# RETURN VALUE
84
85Returns CURLE_OK if TLS enabled, CURLE_UNKNOWN_OPTION if not, or
86CURLE_OUT_OF_MEMORY if there was insufficient heap space.
87