Imported Upstream version 7.40.0
[platform/upstream/curl.git] / tests / data / test153
1 <testcase>
2 <info>
3 <keywords>
4 HTTP
5 HTTP GET
6 HTTP Digest auth
7 </keywords>
8 </info>
9
10 # Server-side
11 <reply>
12 # reply back and ask for Digest auth
13 <data1>
14 HTTP/1.1 401 Authorization Required swsclose\r
15 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
16 WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"\r
17 Content-Type: text/html; charset=iso-8859-1\r
18 Content-Length: 26\r
19 \r
20 This is not the real page
21 </data1>
22
23 # This is supposed to be returned when the server gets a
24 # Authorization: Digest line passed-in from the client
25 <data1001>
26 HTTP/1.1 200 OK\r
27 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
28 Content-Type: text/html; charset=iso-8859-1\r
29 Content-Length: 23\r
30 \r
31 This IS the real page!
32 </data1001>
33
34 #
35 # This is the second request, and this sends back a response saying that
36 # the request contained stale data. We want an update. Set swsbounce to
37 # bounce on to data1003 on the second request.
38 <data1002>
39 HTTP/1.1 401 Authorization re-negotiation please swsbounce\r
40 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
41 WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth"\r
42 Content-Type: text/html; charset=iso-8859-1\r
43 Content-Length: 25\r
44 \r
45 This is not the real page
46 </data1002>
47
48 # The second request to the 1002 section will bounce this one back instead
49 # thanks to the swsbounce keyword up there
50 <data1003>
51 HTTP/1.1 200 OK\r
52 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
53 Content-Type: text/html; charset=iso-8859-1\r
54 Content-Length: 30\r
55 \r
56 This IS the second real page!
57 </data1003>
58 </reply>
59
60 # Client-side
61 <client>
62 <server>
63 http
64 </server>
65 <features>
66 !SSPI
67 crypto
68 </features>
69  <name>
70 HTTP with Digest authorization with stale=true
71  </name>
72  <command>
73 http://%HOSTIP:%HTTPPORT/1530001 -u testuser:testpass --digest http://%HOSTIP:%HTTPPORT/1530002
74 </command>
75 </client>
76
77 # Verify data after the test has been "shot"
78 <verify>
79 <strip>
80 ^Authorization.*cnonce
81 ^User-Agent:.*
82 </strip>
83 <protocol>
84 GET /1530001 HTTP/1.1\r
85 Host: %HOSTIP:%HTTPPORT\r
86 Accept: */*\r
87 \r
88 GET /1530001 HTTP/1.1\r
89 Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/1530001", response="f4f83139396995bac665f24a1f1055c7"\r
90 User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3\r
91 Host: %HOSTIP:%HTTPPORT\r
92 Accept: */*\r
93 \r
94 GET /1530002 HTTP/1.1\r
95 Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/1530002", response="f84511b014fdd0ba6494f42871079c32"\r
96 User-Agent: curl/7.11.0-CVS (i686-pc-linux-gnu) libcurl/7.11.0-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS\r
97 Host: %HOSTIP:%HTTPPORT\r
98 Accept: */*\r
99 \r
100 GET /1530002 HTTP/1.1\r
101 Authorization: Digest username="testuser", realm="testrealm", nonce="999999", uri="/1530002", cnonce="MTA4MzIy", nc="00000001", qop="auth", response="25291c357671604a16c0242f56721c07", algorithm="MD5"\r
102 User-Agent: curl/7.11.0-CVS (i686-pc-linux-gnu) libcurl/7.11.0-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS\r
103 Host: %HOSTIP:%HTTPPORT\r
104 Accept: */*\r
105 \r
106 </protocol>
107 <stdout>
108 HTTP/1.1 401 Authorization Required swsclose\r
109 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
110 WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"\r
111 Content-Type: text/html; charset=iso-8859-1\r
112 Content-Length: 26\r
113 \r
114 HTTP/1.1 200 OK\r
115 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
116 Content-Type: text/html; charset=iso-8859-1\r
117 Content-Length: 23\r
118 \r
119 This IS the real page!
120 HTTP/1.1 401 Authorization re-negotiation please swsbounce\r
121 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
122 WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth"\r
123 Content-Type: text/html; charset=iso-8859-1\r
124 Content-Length: 25\r
125 \r
126 HTTP/1.1 200 OK\r
127 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
128 Content-Type: text/html; charset=iso-8859-1\r
129 Content-Length: 30\r
130 \r
131 This IS the second real page!
132 </stdout>
133 </verify>
134 </testcase>