| 1 |
<info> |
| 2 |
<keywords> |
| 3 |
HTTP |
| 4 |
HTTP GET |
| 5 |
HTTP Digest auth |
| 6 |
</keywords> |
| 7 |
</info> |
| 8 |
# Server-side |
| 9 |
<reply> |
| 10 |
<data> |
| 11 |
HTTP/1.1 401 Authorization Required |
| 12 |
Server: Apache/1.3.27 (Darwin) PHP/4.1.2 |
| 13 |
WWW-Authenticate: Basic realm="foothis" |
| 14 |
WWW-Authenticate: Digest realm="testrealm", nonce="1053604199" |
| 15 |
Content-Type: text/html; charset=iso-8859-1 |
| 16 |
Content-Length: 26 |
| 17 |
|
| 18 |
This is not the real page |
| 19 |
</data> |
| 20 |
|
| 21 |
# This is supposed to be returned when the server gets a |
| 22 |
# Authorization: Digest line passed-in from the client |
| 23 |
<data1000> |
| 24 |
HTTP/1.1 200 OK |
| 25 |
Server: Apache/1.3.27 (Darwin) PHP/4.1.2 |
| 26 |
Content-Type: text/html; charset=iso-8859-1 |
| 27 |
Content-Length: 23 |
| 28 |
|
| 29 |
This IS the real page! |
| 30 |
</data1000> |
| 31 |
|
| 32 |
<datacheck> |
| 33 |
HTTP/1.1 401 Authorization Required |
| 34 |
Server: Apache/1.3.27 (Darwin) PHP/4.1.2 |
| 35 |
WWW-Authenticate: Basic realm="foothis" |
| 36 |
WWW-Authenticate: Digest realm="testrealm", nonce="1053604199" |
| 37 |
Content-Type: text/html; charset=iso-8859-1 |
| 38 |
Content-Length: 26 |
| 39 |
|
| 40 |
HTTP/1.1 200 OK |
| 41 |
Server: Apache/1.3.27 (Darwin) PHP/4.1.2 |
| 42 |
Content-Type: text/html; charset=iso-8859-1 |
| 43 |
Content-Length: 23 |
| 44 |
|
| 45 |
This IS the real page! |
| 46 |
</datacheck> |
| 47 |
|
| 48 |
</reply> |
| 49 |
|
| 50 |
# Client-side |
| 51 |
<client> |
| 52 |
<server> |
| 53 |
http |
| 54 |
</server> |
| 55 |
<name> |
| 56 |
HTTP with Digest *OR* Basic authorization |
| 57 |
</name> |
| 58 |
<command> |
| 59 |
http://%HOSTIP:%HTTPPORT/72 -u testuser:testpass --anyauth |
| 60 |
</command> |
| 61 |
</client> |
| 62 |
|
| 63 |
# Verify data after the test has been "shot" |
| 64 |
<verify> |
| 65 |
<strip> |
| 66 |
^User-Agent:.* |
| 67 |
</strip> |
| 68 |
<protocol> |
| 69 |
GET /72 HTTP/1.1 |
| 70 |
User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3 |
| 71 |
Host: 127.0.0.1:%HTTPPORT |
| 72 |
Accept: */* |
| 73 |
|
| 74 |
GET /72 HTTP/1.1 |
| 75 |
Authorization: Digest username="testuser", realm="testrealm", nonce="1053604199", uri="/72", response="9fcd1330377365a09bbcb33b2cbb25bd" |
| 76 |
User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3 |
| 77 |
Host: 127.0.0.1:%HTTPPORT |
| 78 |
Accept: */* |
| 79 |
|
| 80 |
</protocol> |
| 81 |
</verify> |