1<testcase> 2<info> 3<keywords> 4HTTP 5HTTP GET 6HTTP Digest auth 7</keywords> 8</info> 9 10# Server-side 11<reply> 12# reply back and ask for Digest auth 13<data1> 14HTTP/1.1 401 Authorization Required swsclose 15Server: Apache/1.3.27 (Darwin) PHP/4.1.2 16WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" 17Content-Type: text/html; charset=iso-8859-1 18Content-Length: 26 19 20This 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> 26HTTP/1.1 200 OK 27Server: Apache/1.3.27 (Darwin) PHP/4.1.2 28Content-Type: text/html; charset=iso-8859-1 29Content-Length: 23 30 31This 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> 39HTTP/1.1 401 Authorization re-negotiation please swsbounce 40Server: Apache/1.3.27 (Darwin) PHP/4.1.2 41WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth" 42Content-Type: text/html; charset=iso-8859-1 43Content-Length: 25 44 45This 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> 51HTTP/1.1 200 OK 52Server: Apache/1.3.27 (Darwin) PHP/4.1.2 53Content-Type: text/html; charset=iso-8859-1 54Content-Length: 30 55 56This IS the second real page! 57</data1003> 58</reply> 59 60# Client-side 61<client> 62<server> 63http 64</server> 65<features> 66crypto 67</features> 68 <name> 69HTTP with Digest authorization with stale=true 70 </name> 71 <command> 72http://%HOSTIP:%HTTPPORT/1530001 -u testuser:testpass --digest http://%HOSTIP:%HTTPPORT/1530002 73</command> 74</client> 75 76# Verify data after the test has been "shot" 77<verify> 78<strip> 79^Authorization.*cnonce 80^User-Agent:.* 81</strip> 82<protocol> 83GET /1530001 HTTP/1.1 84Host: %HOSTIP:%HTTPPORT 85Accept: */* 86 87GET /1530001 HTTP/1.1 88Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/1530001", response="f4f83139396995bac665f24a1f1055c7" 89User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3 90Host: %HOSTIP:%HTTPPORT 91Accept: */* 92 93GET /1530002 HTTP/1.1 94Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/1530002", response="f84511b014fdd0ba6494f42871079c32" 95User-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 96Host: %HOSTIP:%HTTPPORT 97Accept: */* 98 99GET /1530002 HTTP/1.1 100Authorization: Digest username="testuser", realm="testrealm", nonce="999999", uri="/1530002", cnonce="MTA4MzIy", nc="00000001", qop="auth", response="25291c357671604a16c0242f56721c07", algorithm="MD5" 101User-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 102Host: %HOSTIP:%HTTPPORT 103Accept: */* 104 105</protocol> 106<stdout> 107HTTP/1.1 401 Authorization Required swsclose 108Server: Apache/1.3.27 (Darwin) PHP/4.1.2 109WWW-Authenticate: Digest realm="testrealm", nonce="1053604145" 110Content-Type: text/html; charset=iso-8859-1 111Content-Length: 26 112 113HTTP/1.1 200 OK 114Server: Apache/1.3.27 (Darwin) PHP/4.1.2 115Content-Type: text/html; charset=iso-8859-1 116Content-Length: 23 117 118This IS the real page! 119HTTP/1.1 401 Authorization re-negotiation please swsbounce 120Server: Apache/1.3.27 (Darwin) PHP/4.1.2 121WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth" 122Content-Type: text/html; charset=iso-8859-1 123Content-Length: 25 124 125HTTP/1.1 200 OK 126Server: Apache/1.3.27 (Darwin) PHP/4.1.2 127Content-Type: text/html; charset=iso-8859-1 128Content-Length: 30 129 130This IS the second real page! 131</stdout> 132</verify> 133</testcase> 134