Imported Upstream version 7.59.0
[platform/upstream/curl.git] / tests / data / test1412
1 <testcase>
2 <info>
3 <keywords>
4 HTTP
5 HTTP GET
6 HTTP Digest auth
7 --anyauth
8 </keywords>
9 </info>
10
11 # Server-side
12 <reply>
13 <servercmd>
14 auth_required
15 </servercmd>
16 <data>
17 HTTP/1.1 401 Authorization Required swsclose
18 Server: Apache/1.3.27 (Darwin) PHP/4.1.2
19 WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
20 WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
21 WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
22 Content-Type: text/html; charset=iso-8859-1
23 Connection: close
24
25 This is not the real page
26 </data>
27
28 # This is supposed to be returned when the server gets a
29 # Authorization: Digest line passed-in from the client
30 <data1000>
31 HTTP/1.1 200 OK swsclose
32 Server: Apache/1.3.27 (Darwin) PHP/4.1.2
33 Content-Type: text/html; charset=iso-8859-1
34 Content-Length: 23
35 Connection: close
36
37 This IS the real page!
38 </data1000>
39
40 # This is the second request
41 <data1001>
42 HTTP/1.1 200 OK swsclose
43 Server: Apache/1.3.27 (Darwin) PHP/4.1.2
44 Content-Type: text/html; charset=iso-8859-1
45 Content-Length: 23
46 Connection: close
47
48 This IS the second real page!
49 </data1001>
50
51 <datacheck>
52 HTTP/1.1 401 Authorization Required swsclose
53 Server: Apache/1.3.27 (Darwin) PHP/4.1.2
54 WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
55 WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
56 WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
57 Content-Type: text/html; charset=iso-8859-1
58 Connection: close
59
60 HTTP/1.1 200 OK swsclose
61 Server: Apache/1.3.27 (Darwin) PHP/4.1.2
62 Content-Type: text/html; charset=iso-8859-1
63 Content-Length: 23
64 Connection: close
65
66 This IS the real page!
67 </datacheck>
68
69 </reply>
70
71 # Client-side
72 <client>
73 <server>
74 http
75 </server>
76 <features>
77 !SSPI
78 crypto
79 </features>
80  <name>
81 HTTP GET with --anyauth with two URLs (picking Digest) 
82  </name>
83  <command>
84 http://%HOSTIP:%HTTPPORT/1412 -u testuser:testpass --anyauth http://%HOSTIP:%HTTPPORT/14120001
85 </command>
86 <file name="log/put1412">
87 This is data we upload with PUT
88 a second line
89 line three
90 four is the number of lines
91 </file>
92 </client>
93
94 # Verify data after the test has been "shot"
95 <verify>
96 <strip>
97 ^User-Agent:.*
98 </strip>
99 <protocol>
100 GET /1412 HTTP/1.1
101 Host: %HOSTIP:%HTTPPORT
102 Accept: */*
103
104 GET /1412 HTTP/1.1
105 Host: %HOSTIP:%HTTPPORT
106 Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/1412", response="0390dbe89e31adca0413d11f91f30e7f"
107 User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
108 Accept: */*
109
110 GET /14120001 HTTP/1.1
111 Host: %HOSTIP:%HTTPPORT
112 Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/14120001", response="0085df91870374c8bf4e94415e7fbf8e"
113 User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
114 Accept: */*
115
116 </protocol>
117 </verify>
118 </testcase>