CURLOPT_PROXY_SSL_VERIFYHOST.md (2299B)
1 --- 2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 SPDX-License-Identifier: curl 4 Title: CURLOPT_PROXY_SSL_VERIFYHOST 5 Section: 3 6 Source: libcurl 7 See-also: 8 - CURLOPT_CAINFO (3) 9 - CURLOPT_PROXY_CAINFO (3) 10 - CURLOPT_PROXY_SSL_VERIFYPEER (3) 11 - CURLOPT_SSL_VERIFYPEER (3) 12 Protocol: 13 - TLS 14 TLS-backend: 15 - All 16 Added-in: 7.52.0 17 --- 18 19 # NAME 20 21 CURLOPT_PROXY_SSL_VERIFYHOST - verify the proxy certificate's name against host 22 23 # SYNOPSIS 24 25 ~~~c 26 #include <curl/curl.h> 27 28 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSL_VERIFYHOST, 29 long verify); 30 ~~~ 31 32 # DESCRIPTION 33 34 Pass a long set to 2L as asking curl to *verify* in the HTTPS proxy's 35 certificate name fields against the proxy name. 36 37 This option determines whether libcurl verifies that the proxy cert contains 38 the correct name for the name it is known as. 39 40 When CURLOPT_PROXY_SSL_VERIFYHOST(3) is 2, the proxy certificate must 41 indicate that the server is the proxy to which you meant to connect to, or the 42 connection fails. 43 44 curl considers the proxy the intended one when the Common Name field or a 45 Subject Alternate Name field in the certificate matches the hostname in the 46 proxy string which you told curl to use. 47 48 If *verify* value is set to 1: 49 50 In 7.28.0 and earlier: treated as a debug option of some sorts, not supported 51 anymore due to frequently leading to programmer mistakes. 52 53 From 7.28.1 to 7.65.3: setting it to 1 made curl_easy_setopt(3) return 54 an error and leaving the flag untouched. 55 56 From 7.66.0: treats 1 and 2 the same. 57 58 When the *verify* value is 0L, the connection succeeds regardless of the 59 names used in the certificate. Use that ability with caution. 60 61 See also CURLOPT_PROXY_SSL_VERIFYPEER(3) to verify the digital signature 62 of the proxy certificate. 63 64 # DEFAULT 65 66 2 67 68 # %PROTOCOLS% 69 70 # EXAMPLE 71 72 ~~~c 73 int main(void) 74 { 75 CURL *curl = curl_easy_init(); 76 if(curl) { 77 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); 78 79 /* Set the default value: strict name check please */ 80 curl_easy_setopt(curl, CURLOPT_PROXY_SSL_VERIFYHOST, 2L); 81 82 curl_easy_perform(curl); 83 } 84 } 85 ~~~ 86 87 # %AVAILABILITY% 88 89 # RETURN VALUE 90 91 curl_easy_setopt(3) returns a CURLcode indicating success or error. 92 93 CURLE_OK (0) means everything was OK, non-zero means an error occurred, see 94 libcurl-errors(3).