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