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