1<testcase> 2<info> 3<keywords> 4HTTP 5HTTP GET 6HTTP Basic auth 7HTTP NTLM auth 8</keywords> 9</info> 10# Server-side 11<reply> 12 13<!-- Alternate the order that Basic and NTLM headers appear in responses to 14ensure that the order doesn't matter. --> 15 16<!-- First request has Basic auth, wrong password --> 17<data100> 18HTTP/1.1 401 Sorry wrong password 19Server: Microsoft-IIS/5.0 20Content-Type: text/html; charset=iso-8859-1 21Content-Length: 29 22WWW-Authenticate: NTLM 23WWW-Authenticate: Basic realm="testrealm" 24 25This is a bad password page! 26</data100> 27 28<!-- Second request has NTLM auth, right password --> 29<data200> 30HTTP/1.1 401 Need Basic or NTLM auth 31Server: Microsoft-IIS/5.0 32Content-Type: text/html; charset=iso-8859-1 33Content-Length: 27 34WWW-Authenticate: Basic realm="testrealm" 35WWW-Authenticate: NTLM 36 37This is not the real page! 38</data200> 39 40<data1201> 41HTTP/1.1 401 NTLM intermediate 42Server: Microsoft-IIS/5.0 43Content-Type: text/html; charset=iso-8859-1 44Content-Length: 33 45WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= 46 47This is still not the real page! 48</data1201> 49 50<data1202> 51HTTP/1.1 200 Things are fine in server land 52Server: Microsoft-IIS/5.0 53Content-Type: text/html; charset=iso-8859-1 54Content-Length: 32 55 56Finally, this is the real page! 57</data1202> 58 59<!-- Third request has Basic auth, wrong password --> 60<data300> 61HTTP/1.1 401 Sorry wrong password (2) 62Server: Microsoft-IIS/5.0 63Content-Type: text/html; charset=iso-8859-1 64Content-Length: 29 65WWW-Authenticate: NTLM 66WWW-Authenticate: Basic realm="testrealm" 67 68This is a bad password page! 69</data300> 70 71<!-- Fourth request has NTLM auth, wrong password --> 72<data400> 73HTTP/1.1 401 Need Basic or NTLM auth (2) 74Server: Microsoft-IIS/5.0 75Content-Type: text/html; charset=iso-8859-1 76Content-Length: 27 77WWW-Authenticate: Basic realm="testrealm" 78WWW-Authenticate: NTLM 79 80This is not the real page! 81</data400> 82 83<data1401> 84HTTP/1.1 401 NTLM intermediate (2) 85Server: Microsoft-IIS/5.0 86Content-Type: text/html; charset=iso-8859-1 87Content-Length: 33 88WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= 89 90This is still not the real page! 91</data1401> 92 93<data1402> 94HTTP/1.1 401 Sorry wrong password (3) 95Server: Microsoft-IIS/5.0 96Content-Type: text/html; charset=iso-8859-1 97Content-Length: 29 98WWW-Authenticate: NTLM 99WWW-Authenticate: Basic realm="testrealm" 100 101This is a bad password page! 102</data1402> 103 104<!-- Fifth request has NTLM auth, right password --> 105<data500> 106HTTP/1.1 401 Need Basic or NTLM auth (3) 107Server: Microsoft-IIS/5.0 108Content-Type: text/html; charset=iso-8859-1 109Content-Length: 27 110WWW-Authenticate: Basic realm="testrealm" 111WWW-Authenticate: NTLM 112 113This is not the real page! 114</data500> 115 116<data1501> 117HTTP/1.1 401 NTLM intermediate (3) 118Server: Microsoft-IIS/5.0 119Content-Type: text/html; charset=iso-8859-1 120Content-Length: 33 121WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= 122 123This is still not the real page! 124</data1501> 125 126<data1502> 127HTTP/1.1 200 Things are fine in server land (2) 128Server: Microsoft-IIS/5.0 129Content-Type: text/html; charset=iso-8859-1 130Content-Length: 32 131 132Finally, this is the real page! 133</data1502> 134 135<datacheck> 136HTTP/1.1 401 Sorry wrong password 137Server: Microsoft-IIS/5.0 138Content-Type: text/html; charset=iso-8859-1 139Content-Length: 29 140WWW-Authenticate: NTLM 141WWW-Authenticate: Basic realm="testrealm" 142 143This is a bad password page! 144HTTP/1.1 401 NTLM intermediate 145Server: Microsoft-IIS/5.0 146Content-Type: text/html; charset=iso-8859-1 147Content-Length: 33 148WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= 149 150HTTP/1.1 200 Things are fine in server land 151Server: Microsoft-IIS/5.0 152Content-Type: text/html; charset=iso-8859-1 153Content-Length: 32 154 155Finally, this is the real page! 156HTTP/1.1 401 Sorry wrong password (2) 157Server: Microsoft-IIS/5.0 158Content-Type: text/html; charset=iso-8859-1 159Content-Length: 29 160WWW-Authenticate: NTLM 161WWW-Authenticate: Basic realm="testrealm" 162 163This is a bad password page! 164HTTP/1.1 401 NTLM intermediate (2) 165Server: Microsoft-IIS/5.0 166Content-Type: text/html; charset=iso-8859-1 167Content-Length: 33 168WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= 169 170HTTP/1.1 401 Sorry wrong password (3) 171Server: Microsoft-IIS/5.0 172Content-Type: text/html; charset=iso-8859-1 173Content-Length: 29 174WWW-Authenticate: NTLM 175WWW-Authenticate: Basic realm="testrealm" 176 177This is a bad password page! 178HTTP/1.1 401 NTLM intermediate (3) 179Server: Microsoft-IIS/5.0 180Content-Type: text/html; charset=iso-8859-1 181Content-Length: 33 182WWW-Authenticate: NTLM TlRMTVNTUAACAAAACAAIADAAAACGgAEAq6U1NAWaJCIAAAAAAAAAAAAAAAA4AAAATlRMTUF1dGg= 183 184HTTP/1.1 200 Things are fine in server land (2) 185Server: Microsoft-IIS/5.0 186Content-Type: text/html; charset=iso-8859-1 187Content-Length: 32 188 189Finally, this is the real page! 190</datacheck> 191 192</reply> 193 194# Client-side 195<client> 196<features> 197NTLM 198!SSPI 199</features> 200<server> 201http 202</server> 203<tool> 204libauthretry 205</tool> 206 207 <name> 208HTTP authorization retry (Basic switching to NTLM) 209 </name> 210 <setenv> 211# we force our own host name, in order to make the test machine independent 212CURL_GETHOSTNAME=curlhost 213# we try to use the LD_PRELOAD hack, if not a debug build 214LD_PRELOAD=%PWD/libtest/.libs/libhostname.so 215 </setenv> 216 <command> 217http://%HOSTIP:%HTTPPORT/2025 basic ntlm 218</command> 219<precheck> 220chkhostname curlhost 221</precheck> 222</client> 223 224# Verify data after the test has been "shot" 225<verify> 226<strip> 227^User-Agent:.* 228</strip> 229<protocol> 230GET /20250100 HTTP/1.1 231Host: %HOSTIP:%HTTPPORT 232Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz 233Accept: */* 234 235GET /20250200 HTTP/1.1 236Host: %HOSTIP:%HTTPPORT 237Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= 238Accept: */* 239 240GET /20250200 HTTP/1.1 241Host: %HOSTIP:%HTTPPORT 242Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAAhoABAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyY3VybGhvc3Q= 243Accept: */* 244 245GET /20250300 HTTP/1.1 246Host: %HOSTIP:%HTTPPORT 247Authorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz 248Accept: */* 249 250GET /20250400 HTTP/1.1 251Host: %HOSTIP:%HTTPPORT 252Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= 253Accept: */* 254 255GET /20250400 HTTP/1.1 256Host: %HOSTIP:%HTTPPORT 257Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAAhoABANgKEcT5xUUBHw5+0m4FjWTGNzg6PeHJHbaPwNwCt/tXcnIeTQCTMAg12SPDyNXMf3Rlc3R1c2VyY3VybGhvc3Q= 258Accept: */* 259 260GET /20250500 HTTP/1.1 261Host: %HOSTIP:%HTTPPORT 262Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= 263Accept: */* 264 265GET /20250500 HTTP/1.1 266Host: %HOSTIP:%HTTPPORT 267Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAAhoABAI+/Fp9IERAQ74OsdNPbBpg7o8CVwLSO4DtFyIcZHUMKVktWIu92s2892OVpd2JzqnRlc3R1c2VyY3VybGhvc3Q= 268Accept: */* 269 270</protocol> 271</verify> 272</testcase> 273