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