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