quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

CURLINFO_PROXY_SSL_VERIFYRESULT.md (1725B)


      1 ---
      2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
      3 SPDX-License-Identifier: curl
      4 Title: CURLINFO_PROXY_SSL_VERIFYRESULT
      5 Section: 3
      6 Source: libcurl
      7 See-also:
      8   - CURLINFO_SSL_VERIFYRESULT (3)
      9   - curl_easy_getinfo (3)
     10   - curl_easy_setopt (3)
     11 Protocol:
     12   - TLS
     13 TLS-backend:
     14   - OpenSSL
     15   - GnuTLS
     16 Added-in: 7.52.0
     17 ---
     18 
     19 # NAME
     20 
     21 CURLINFO_PROXY_SSL_VERIFYRESULT - get the result of the proxy certificate verification
     22 
     23 # SYNOPSIS
     24 
     25 ~~~c
     26 #include <curl/curl.h>
     27 
     28 CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PROXY_SSL_VERIFYRESULT,
     29                            long *result);
     30 ~~~
     31 
     32 # DESCRIPTION
     33 
     34 Pass a pointer to a long to receive the result of the certificate verification
     35 that was requested (using the CURLOPT_PROXY_SSL_VERIFYPEER(3)
     36 option. This is only used for HTTPS proxies.
     37 
     38 0 is a positive result. Non-zero is an error.
     39 
     40 # %PROTOCOLS%
     41 
     42 # EXAMPLE
     43 
     44 ~~~c
     45 int main(void)
     46 {
     47   CURL *curl = curl_easy_init();
     48   if(curl) {
     49     CURLcode res;
     50     long verifyresult;
     51 
     52     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
     53     curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy:443");
     54 
     55     res = curl_easy_perform(curl);
     56     if(res) {
     57       printf("error: %s\n", curl_easy_strerror(res));
     58       curl_easy_cleanup(curl);
     59       return 1;
     60     }
     61 
     62     res = curl_easy_getinfo(curl, CURLINFO_PROXY_SSL_VERIFYRESULT,
     63                             &verifyresult);
     64     if(!res) {
     65       printf("The peer verification said %s\n",
     66              (verifyresult ? "bad" : "fine"));
     67     }
     68     curl_easy_cleanup(curl);
     69   }
     70 }
     71 ~~~
     72 
     73 # %AVAILABILITY%
     74 
     75 # RETURN VALUE
     76 
     77 curl_easy_getinfo(3) returns a CURLcode indicating success or error.
     78 
     79 CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
     80 libcurl-errors(3).