quickjs-tart

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

CURLOPT_PROXY_CAINFO_BLOB.md (2274B)


      1 ---
      2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
      3 SPDX-License-Identifier: curl
      4 Title: CURLOPT_PROXY_CAINFO_BLOB
      5 Section: 3
      6 Source: libcurl
      7 See-also:
      8   - CURLOPT_CAINFO (3)
      9   - CURLOPT_CAINFO_BLOB (3)
     10   - CURLOPT_CAPATH (3)
     11   - CURLOPT_PROXY_CAINFO (3)
     12   - CURLOPT_PROXY_CAPATH (3)
     13   - CURLOPT_PROXY_SSL_VERIFYHOST (3)
     14   - CURLOPT_PROXY_SSL_VERIFYPEER (3)
     15   - CURLOPT_SSL_VERIFYHOST (3)
     16   - CURLOPT_SSL_VERIFYPEER (3)
     17 Protocol:
     18   - TLS
     19 TLS-backend:
     20   - OpenSSL
     21   - rustls
     22   - Schannel
     23 Added-in: 7.77.0
     24 ---
     25 
     26 # NAME
     27 
     28 CURLOPT_PROXY_CAINFO_BLOB - proxy Certificate Authority (CA) bundle in PEM format
     29 
     30 # SYNOPSIS
     31 
     32 ~~~c
     33 #include <curl/curl.h>
     34 
     35 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_CAINFO_BLOB,
     36                           struct curl_blob *stblob);
     37 ~~~
     38 
     39 # DESCRIPTION
     40 
     41 This option is for connecting to an HTTPS proxy, not an HTTPS server.
     42 
     43 Pass a pointer to a curl_blob structure, which contains information (pointer
     44 and size) about a memory block with binary data of PEM encoded content holding
     45 one or more certificates to verify the HTTPS proxy with.
     46 
     47 If the blob is initialized with the flags member of struct curl_blob set to
     48 CURL_BLOB_COPY, the application does not have to keep the buffer around after
     49 setting this.
     50 
     51 If CURLOPT_PROXY_SSL_VERIFYPEER(3) is zero and you avoid verifying the
     52 server's certificate, CURLOPT_PROXY_CAINFO_BLOB(3) is not needed.
     53 
     54 This option overrides CURLOPT_PROXY_CAINFO(3).
     55 
     56 # DEFAULT
     57 
     58 NULL
     59 
     60 # %PROTOCOLS%
     61 
     62 # EXAMPLE
     63 
     64 ~~~c
     65 #include <string.h> /* for strlen */
     66 
     67 extern char *strpem; /* strpem must point to a PEM string */
     68 int main(void)
     69 {
     70   CURL *curl = curl_easy_init();
     71   if(curl) {
     72     CURLcode res;
     73     struct curl_blob blob;
     74     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
     75     /* using an HTTPS proxy */
     76     curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:443");
     77     blob.data = strpem;
     78     blob.len = strlen(strpem);
     79     blob.flags = CURL_BLOB_COPY;
     80     curl_easy_setopt(curl, CURLOPT_PROXY_CAINFO_BLOB, &blob);
     81     res = curl_easy_perform(curl);
     82     curl_easy_cleanup(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).