test1412 (3172B)
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 digest 93 </features> 94 <name> 95 HTTP GET with --anyauth with two URLs (picking Digest) 96 </name> 97 <command> 98 http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --anyauth http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 99 </command> 100 </client> 101 102 # Verify data after the test has been "shot" 103 <verify> 104 <protocol> 105 GET /%TESTNUMBER HTTP/1.1 106 Host: %HOSTIP:%HTTPPORT 107 User-Agent: curl/%VERSION 108 Accept: */* 109 110 GET /%TESTNUMBER HTTP/1.1 111 Host: %HOSTIP:%HTTPPORT 112 Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER", response="0390dbe89e31adca0413d11f91f30e7f" 113 User-Agent: curl/%VERSION 114 Accept: */* 115 116 GET /%TESTNUMBER0001 HTTP/1.1 117 Host: %HOSTIP:%HTTPPORT 118 User-Agent: curl/%VERSION 119 Accept: */* 120 121 GET /%TESTNUMBER0001 HTTP/1.1 122 Host: %HOSTIP:%HTTPPORT 123 Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER0001", response="0085df91870374c8bf4e94415e7fbf8e" 124 User-Agent: curl/%VERSION 125 Accept: */* 126 127 </protocol> 128 </verify> 129 </testcase>