quickjs-tart

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

CURLOPT_CAINFO_BLOB.md (2056B)


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