quickjs-tart

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

CURLOPT_PROXY_SSLVERSION.md (2689B)


      1 ---
      2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
      3 SPDX-License-Identifier: curl
      4 Title: CURLOPT_PROXY_SSLVERSION
      5 Section: 3
      6 Source: libcurl
      7 See-also:
      8   - CURLOPT_HTTP_VERSION (3)
      9   - CURLOPT_IPRESOLVE (3)
     10   - CURLOPT_SSLVERSION (3)
     11   - CURLOPT_USE_SSL (3)
     12 Protocol:
     13   - TLS
     14 TLS-backend:
     15   - All
     16 Added-in: 7.52.0
     17 ---
     18 
     19 # NAME
     20 
     21 CURLOPT_PROXY_SSLVERSION - preferred HTTPS proxy TLS version
     22 
     23 # SYNOPSIS
     24 
     25 ~~~c
     26 #include <curl/curl.h>
     27 
     28 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSLVERSION,
     29                           long version);
     30 ~~~
     31 
     32 # DESCRIPTION
     33 
     34 Pass a long as parameter to control which version of SSL/TLS to attempt to use
     35 when connecting to an HTTPS proxy.
     36 
     37 Use one of the available defines for this purpose. The available options are:
     38 
     39 ## CURL_SSLVERSION_DEFAULT
     40 
     41 The default action. This attempts to figure out the remote SSL protocol
     42 version.
     43 
     44 ## CURL_SSLVERSION_TLSv1
     45 
     46 TLSv1.x
     47 
     48 ## CURL_SSLVERSION_TLSv1_0
     49 
     50 TLSv1.0
     51 
     52 ## CURL_SSLVERSION_TLSv1_1
     53 
     54 TLSv1.1
     55 
     56 ## CURL_SSLVERSION_TLSv1_2
     57 
     58 TLSv1.2
     59 
     60 ## CURL_SSLVERSION_TLSv1_3
     61 
     62 TLSv1.3
     63 
     64 ##
     65 
     66 The maximum TLS version can be set by using *one* of the CURL_SSLVERSION_MAX_
     67 macros below. It is also possible to OR *one* of the CURL_SSLVERSION_ macros
     68 with *one* of the CURL_SSLVERSION_MAX_ macros. The MAX macros are not
     69 supported for wolfSSL.
     70 
     71 ## CURL_SSLVERSION_MAX_DEFAULT
     72 
     73 The flag defines the maximum supported TLS version as TLSv1.2, or the default
     74 value from the SSL library.
     75 (Added in 7.54.0)
     76 
     77 ## CURL_SSLVERSION_MAX_TLSv1_0
     78 
     79 The flag defines maximum supported TLS version as TLSv1.0.
     80 (Added in 7.54.0)
     81 
     82 ## CURL_SSLVERSION_MAX_TLSv1_1
     83 
     84 The flag defines maximum supported TLS version as TLSv1.1.
     85 (Added in 7.54.0)
     86 
     87 ## CURL_SSLVERSION_MAX_TLSv1_2
     88 
     89 The flag defines maximum supported TLS version as TLSv1.2.
     90 (Added in 7.54.0)
     91 
     92 ## CURL_SSLVERSION_MAX_TLSv1_3
     93 
     94 The flag defines maximum supported TLS version as TLSv1.3.
     95 (Added in 7.54.0)
     96 
     97 ##
     98 
     99 In versions of curl prior to 7.54 the CURL_SSLVERSION_TLS options were
    100 documented to allow *only* the specified TLS version, but behavior was
    101 inconsistent depending on the TLS library.
    102 
    103 # DEFAULT
    104 
    105 CURL_SSLVERSION_DEFAULT
    106 
    107 # %PROTOCOLS%
    108 
    109 # EXAMPLE
    110 
    111 ~~~c
    112 int main(void)
    113 {
    114   CURL *curl = curl_easy_init();
    115   if(curl) {
    116     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
    117 
    118     /* ask libcurl to use TLS version 1.0 or later */
    119     curl_easy_setopt(curl, CURLOPT_SSLVERSION, (long)CURL_SSLVERSION_TLSv1);
    120 
    121     /* Perform the request */
    122     curl_easy_perform(curl);
    123   }
    124 }
    125 ~~~
    126 
    127 # %AVAILABILITY%
    128 
    129 # RETURN VALUE
    130 
    131 curl_easy_setopt(3) returns a CURLcode indicating success or error.
    132 
    133 CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
    134 libcurl-errors(3).