quickjs-tart

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

test1481 (3078B)


      1 <testcase>
      2 <info>
      3 <keywords>
      4 HTTP
      5 HTTP GET
      6 --libcurl
      7 </keywords>
      8 </info>
      9 
     10 # Server-side
     11 <reply>
     12 <data>
     13 HTTP/1.1 200 OK
     14 Date: Thu, 29 Jul 2008 14:49:00 GMT
     15 Server: test-server/fake
     16 Content-Length: 0
     17 Connection: close
     18 
     19 </data>
     20 </reply>
     21 
     22 # Client-side
     23 <client>
     24 <server>
     25 http
     26 </server>
     27 <features>
     28 proxy
     29 SSL
     30 --libcurl
     31 </features>
     32 <name>
     33 --libcurl with TLS version options
     34 </name>
     35 <setenv>
     36 SSL_CERT_FILE=
     37 </setenv>
     38 <command>
     39 http://moo/ --libcurl %LOGDIR/test%TESTNUMBER.c --tls-max 1.3 --proxy-tlsv1 -x http://%HOSTIP:%HTTPPORT
     40 </command>
     41 </client>
     42 
     43 # Verify data after the test has been "shot"
     44 <verify>
     45 <protocol>
     46 GET http://moo/ HTTP/1.1
     47 Host: moo
     48 User-Agent: curl/%VERSION
     49 Accept: */*
     50 Proxy-Connection: Keep-Alive
     51 
     52 </protocol>
     53 <stripfile>
     54 s/(USERAGENT, \")[^\"]+/${1}stripped/
     55 # CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with
     56 # CURLOPT_INTERLEAVEDATA requires RTSP protocol
     57 # configurations - just ignore them
     58 $_ = '' if /CURLOPT_SSL_VERIFYPEER/
     59 $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
     60 $_ = '' if /CURLOPT_HTTP_VERSION/
     61 $_ = '' if /CURLOPT_HTTP09_ALLOWED/
     62 $_ = '' if /CURLOPT_INTERLEAVEDATA/
     63 </stripfile>
     64 <file name="%LOGDIR/test%TESTNUMBER.c" mode="text">
     65 /********* Sample code generated by the curl command line tool **********
     66  * All curl_easy_setopt() options are documented at:
     67  * https://curl.se/libcurl/c/curl_easy_setopt.html
     68  ************************************************************************/
     69 #include <curl/curl.h>
     70 
     71 int main(int argc, char *argv[])
     72 {
     73   CURLcode ret;
     74   CURL *hnd;
     75 
     76   hnd = curl_easy_init();
     77   curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
     78   curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
     79   curl_easy_setopt(hnd, CURLOPT_URL, "http://moo/");
     80   curl_easy_setopt(hnd, CURLOPT_PROXY, "http://%HOSTIP:%HTTPPORT");
     81   curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped");
     82   curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
     83   curl_easy_setopt(hnd, CURLOPT_SSLVERSION, (long)(CURL_SSLVERSION_DEFAULT | CURL_SSLVERSION_MAX_TLSv1_3));
     84   curl_easy_setopt(hnd, CURLOPT_PROXY_SSLVERSION, (long)(CURL_SSLVERSION_TLSv1 | CURL_SSLVERSION_MAX_NONE));
     85   curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
     86 
     87   /* Here is a list of options the curl code used that cannot get generated
     88      as source easily. You may choose to either not use them or implement
     89      them yourself.
     90 
     91   CURLOPT_DEBUGFUNCTION was set to a function pointer
     92   CURLOPT_DEBUGDATA was set to an object pointer
     93   CURLOPT_WRITEDATA was set to an object pointer
     94   CURLOPT_WRITEFUNCTION was set to a function pointer
     95   CURLOPT_READDATA was set to an object pointer
     96   CURLOPT_READFUNCTION was set to a function pointer
     97   CURLOPT_SEEKDATA was set to an object pointer
     98   CURLOPT_SEEKFUNCTION was set to a function pointer
     99   CURLOPT_HEADERFUNCTION was set to a function pointer
    100   CURLOPT_HEADERDATA was set to an object pointer
    101   CURLOPT_ERRORBUFFER was set to an object pointer
    102   CURLOPT_STDERR was set to an object pointer
    103 
    104   */
    105 
    106   ret = curl_easy_perform(hnd);
    107 
    108   curl_easy_cleanup(hnd);
    109   hnd = NULL;
    110 
    111   return (int)ret;
    112 }
    113 /**** End of sample code ****/
    114 </file>
    115 </verify>
    116 </testcase>