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
20Added-in: 7.52.0
21---
22
23# NAME
24
25CURLOPT_PROXY_SSLKEY - private key file for HTTPS proxy client cert
26
27# SYNOPSIS
28
29~~~c
30#include <curl/curl.h>
31
32CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSLKEY, char *keyfile);
33~~~
34
35# DESCRIPTION
36
37Pass a pointer to a null-terminated string as parameter. The string should be
38the filename of your private key used for connecting to the HTTPS proxy. The
39default format is "PEM" and can be changed with
40CURLOPT_PROXY_SSLKEYTYPE(3).
41
42(Windows, iOS and macOS) This option is ignored by Secure Transport and
43Schannel SSL backends because they expect the private key to be already
44present in the key chain or PKCS#12 file containing the certificate.
45
46The application does not have to keep the string around after setting this
47option.
48
49Using this option multiple times makes the last set string override the
50previous ones. Set it to NULL to disable its use again.
51
52# DEFAULT
53
54NULL
55
56# %PROTOCOLS%
57
58# EXAMPLE
59
60~~~c
61int main(void)
62{
63  CURL *curl = curl_easy_init();
64  if(curl) {
65    CURLcode res;
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_SSLCERT, "client.pem");
69    curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY, "key.pem");
70    curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "s3cret");
71    res = curl_easy_perform(curl);
72    curl_easy_cleanup(curl);
73  }
74}
75~~~
76
77# %AVAILABILITY%
78
79# RETURN VALUE
80
81Returns CURLE_OK if TLS is supported, CURLE_UNKNOWN_OPTION if not, or
82CURLE_OUT_OF_MEMORY if there was insufficient heap space.
83