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