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