1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_PROXY_SSLKEY
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_PROXY_SSLCERT (3)
9  - CURLOPT_PROXY_SSLKEYTYPE (3)
10  - CURLOPT_SSLCERT (3)
11  - CURLOPT_SSLKEY (3)
12  - CURLOPT_SSLKEYTYPE (3)
13Protocol:
14  - TLS
15TLS-backend:
16  - OpenSSL
17  - mbedTLS
18  - Schannel
19  - wolfSSL
20---
21
22# NAME
23
24CURLOPT_PROXY_SSLKEY - private key file for HTTPS proxy client cert
25
26# SYNOPSIS
27
28~~~c
29#include <curl/curl.h>
30
31CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSLKEY, char *keyfile);
32~~~
33
34# DESCRIPTION
35
36Pass a pointer to a null-terminated string as parameter. The string should be
37the filename of your private key used for connecting to the HTTPS proxy. The
38default format is "PEM" and can be changed with
39CURLOPT_PROXY_SSLKEYTYPE(3).
40
41(Windows, iOS and Mac OS X) This option is ignored by Secure Transport and
42Schannel SSL backends because they expect the private key to be already
43present in the key chain or PKCS#12 file containing the certificate.
44
45The application does not have to keep the string around after setting this
46option.
47
48# DEFAULT
49
50NULL
51
52# EXAMPLE
53
54~~~c
55int main(void)
56{
57  CURL *curl = curl_easy_init();
58  if(curl) {
59    CURLcode res;
60    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
61    curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy");
62    curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT, "client.pem");
63    curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY, "key.pem");
64    curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "s3cret");
65    res = curl_easy_perform(curl);
66    curl_easy_cleanup(curl);
67  }
68}
69~~~
70
71# AVAILABILITY
72
73Added in 7.52.0
74
75If built TLS enabled.
76
77# RETURN VALUE
78
79Returns CURLE_OK if TLS is supported, CURLE_UNKNOWN_OPTION if not, or
80CURLE_OUT_OF_MEMORY if there was insufficient heap space.
81