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
20---
21
22# NAME
23
24CURLOPT_PROXY_SSLCERT - HTTPS proxy client certificate
25
26# SYNOPSIS
27
28~~~c
29#include <curl/curl.h>
30
31CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSLCERT, char *cert);
32~~~
33
34# DESCRIPTION
35
36This option is for connecting to an HTTPS proxy, not an HTTPS server.
37
38Pass a pointer to a null-terminated string as parameter. The string should be
39the filename of your client certificate used to connect to the HTTPS proxy.
40The default format is "P12" on Secure Transport and "PEM" on other engines,
41and can be changed with CURLOPT_PROXY_SSLCERTTYPE(3).
42
43With Secure Transport, this can also be the nickname of the certificate you
44wish to authenticate with as it is named in the security database. If you want
45to use a file from the current directory, please precede it with "./" prefix,
46in order to avoid confusion with a nickname.
47
48When using a client certificate, you most likely also need to provide a
49private key with CURLOPT_PROXY_SSLKEY(3).
50
51The application does not have to keep the string around after setting this
52option.
53
54# DEFAULT
55
56NULL
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
79Added in 7.52.0
80
81# RETURN VALUE
82
83Returns CURLE_OK if TLS enabled, CURLE_UNKNOWN_OPTION if not, or
84CURLE_OUT_OF_MEMORY if there was insufficient heap space.
85