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