1CURLOPT_PROXY_SSL_VERIFYPEER(3) libcurl CURLOPT_PROXY_SSL_VERIFYPEER(3)
2
3
4
6 CURLOPT_PROXY_SSL_VERIFYPEER - verify the proxy's SSL certificate
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSL_VERIFYPEER,
12 long verify);
13
15 Pass a long as parameter set to 1L to enable or 0L to disable.
16
17 This option tells curl to verify the authenticity of the HTTPS proxy's
18 certificate. A value of 1 means curl verifies; 0 (zero) means it does
19 not.
20
21 This is the proxy version of CURLOPT_SSL_VERIFYPEER(3) that is used for
22 ordinary HTTPS servers.
23
24 When negotiating a TLS or SSL connection, the server sends a certifi‐
25 cate indicating its identity. Curl verifies whether the certificate is
26 authentic, i.e. that you can trust that the server is who the certifi‐
27 cate says it is. This trust is based on a chain of digital signatures,
28 rooted in certification authority (CA) certificates you supply. curl
29 uses a default bundle of CA certificates (the path for that is deter‐
30 mined at build time) and you can specify alternate certificates with
31 the CURLOPT_PROXY_CAINFO(3) option or the CURLOPT_PROXY_CAPATH(3) op‐
32 tion.
33
34 When CURLOPT_PROXY_SSL_VERIFYPEER(3) is enabled, and the verification
35 fails to prove that the certificate is authentic, the connection fails.
36 When the option is zero, the peer certificate verification succeeds re‐
37 gardless.
38
39 Authenticating the certificate is not enough to be sure about the
40 server. You typically also want to ensure that the server is the server
41 you mean to be talking to. Use CURLOPT_PROXY_SSL_VERIFYHOST(3) for
42 that. The check that the host name in the certificate is valid for the
43 host name you are connecting to is done independently of the CUR‐
44 LOPT_PROXY_SSL_VERIFYPEER(3) option.
45
46 WARNING: disabling verification of the certificate allows bad guys to
47 man-in-the-middle the communication without you knowing it. Disabling
48 verification makes the communication insecure. Just having encryption
49 on a transfer is not enough as you cannot be sure that you are communi‐
50 cating with the correct end-point.
51
53 1
54
56 All
57
59 CURL *curl = curl_easy_init();
60 if(curl) {
61 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
62
63 /* Set the default value: strict certificate check please */
64 curl_easy_setopt(curl, CURLOPT_PROXY_SSL_VERIFYPEER, 1L);
65
66 curl_easy_perform(curl);
67 }
68
70 Added in 7.52.0
71
72 If built TLS enabled.
73
75 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
76 if not.
77
79 CURLOPT_PROXY_SSL_VERIFYHOST(3), CURLOPT_SSL_VERIFYPEER(3), CUR‐
80 LOPT_SSL_VERIFYHOST(3),
81
82
83
84ibcurl 8.2.1 April 26, 2023 CURLOPT_PROXY_SSL_VERIFYPEER(3)