1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_PROXY_SSLCERT
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_PROXY_SSLCERTTYPE (3)
9  - CURLOPT_PROXY_SSLKEY (3)
10  - CURLOPT_SSLCERT (3)
11Protocol:
12  - TLS
13TLS-backend:
14  - OpenSSL
15  - GnuTLS
16  - mbedTLS
17  - Schannel
18  - Secure Transport
19  - wolfSSL
20Added-in: 7.52.0
21---
22
23# NAME
24
25CURLOPT_PROXY_SSLCERT - HTTPS proxy client certificate
26
27# SYNOPSIS
28
29~~~c
30#include <curl/curl.h>
31
32CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSLCERT, char *cert);
33~~~
34
35# DESCRIPTION
36
37This option is for connecting to an HTTPS proxy, not an HTTPS server.
38
39Pass a pointer to a null-terminated string as parameter. The string should be
40the filename of your client certificate used to connect to the HTTPS proxy.
41The default format is "P12" on Secure Transport and "PEM" on other engines,
42and can be changed with CURLOPT_PROXY_SSLCERTTYPE(3).
43
44With Secure Transport, this can also be the nickname of the certificate you
45wish to authenticate with as it is named in the security database. If you want
46to use a file from the current directory, please precede it with "./" prefix,
47in order to avoid confusion with a nickname.
48
49When using a client certificate, you most likely also need to provide a
50private key with CURLOPT_PROXY_SSLKEY(3).
51
52The application does not have to keep the string around after setting this
53option.
54
55Using this option multiple times makes the last set string override the
56previous ones. Set it to NULL to disable its use again.
57
58# DEFAULT
59
60NULL
61
62# %PROTOCOLS%
63
64# EXAMPLE
65
66~~~c
67int main(void)
68{
69  CURL *curl = curl_easy_init();
70  if(curl) {
71    CURLcode res;
72    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
73    curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy");
74    curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT, "client.pem");
75    curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY, "key.pem");
76    curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "s3cret");
77    res = curl_easy_perform(curl);
78    curl_easy_cleanup(curl);
79  }
80}
81~~~
82
83# %AVAILABILITY%
84
85# RETURN VALUE
86
87Returns CURLE_OK if TLS enabled, CURLE_UNKNOWN_OPTION if not, or
88CURLE_OUT_OF_MEMORY if there was insufficient heap space.
89