1<testcase> 2<info> 3<keywords> 4HTTP 5HTTP GET 6HTTP CONNECT 7HTTP proxy 8HTTP proxy NTLM auth 9</keywords> 10</info> 11 12# Server-side 13<reply> 14<servercmd> 15connection-monitor 16</servercmd> 17 18# this is returned first since we get no proxy-auth 19<connect1001> 20HTTP/1.1 407 Authorization Required to proxy me my dear 21Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== 22Transfer-Encoding: chunked 23 2420 25And you should ignore this data. 26FA0 27XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX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XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 280 29 30</connect1001> 31 32# This is supposed to be returned when the server gets the second 33# Authorization: NTLM line passed-in from the client 34<connect1002> 35HTTP/1.1 200 Things are fine in proxy land 36Server: Microsoft-IIS/5.0 37Content-Type: text/html; charset=iso-8859-1 38 39</connect1002> 40 41# this is returned when we get a GET! 42<data2> 43HTTP/1.1 200 OK 44Date: Thu, 09 Nov 2010 14:49:00 GMT 45Content-Length: 7 46Connection: close 47Content-Type: text/html 48Funny-head: yesyes 49 50daniel 51</data2> 52 53# then this is returned when we get proxy-auth 54<data1000> 55HTTP/1.1 200 OK swsbounce 56Server: no 57 58Nice proxy auth sir! 59</data1000> 60 61<datacheck> 62HTTP/1.1 407 Authorization Required to proxy me my dear 63Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA== 64Transfer-Encoding: chunked 65 66HTTP/1.1 200 Things are fine in proxy land 67Server: Microsoft-IIS/5.0 68Content-Type: text/html; charset=iso-8859-1 69 70HTTP/1.1 200 OK 71Date: Thu, 09 Nov 2010 14:49:00 GMT 72Content-Length: 7 73Connection: close 74Content-Type: text/html 75Funny-head: yesyes 76 77daniel 78</datacheck> 79</reply> 80 81# Client-side 82<client> 83<server> 84http 85</server> 86<features> 87NTLM 88!SSPI 89debug 90</features> 91 <name> 92HTTP proxy CONNECT auth NTLM with chunked-encoded 407 response 93 </name> 94 <setenv> 95# we force our own host name, in order to make the test machine independent 96CURL_GETHOSTNAME=curlhost 97# we try to use the LD_PRELOAD hack, if not a debug build 98LD_PRELOAD=%PWD/libtest/.libs/libhostname.so 99 </setenv> 100 <command> 101http://test.remote.example.com.1008:%HTTPPORT/path/10080002 --proxy http://%HOSTIP:%HTTPPORT --proxy-user testuser:testpass --proxy-ntlm --proxytunnel 102</command> 103<precheck> 104chkhostname curlhost 105</precheck> 106</client> 107 108# Verify data after the test has been "shot" 109<verify> 110<strip> 111^User-Agent: curl/.* 112</strip> 113<protocol> 114CONNECT test.remote.example.com.1008:%HTTPPORT HTTP/1.1 115Host: test.remote.example.com.1008:%HTTPPORT 116Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= 117Proxy-Connection: Keep-Alive 118 119CONNECT test.remote.example.com.1008:%HTTPPORT HTTP/1.1 120Host: test.remote.example.com.1008:%HTTPPORT 121Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAACeAJ4AWAAAAAAAAAD2AAAACAAIAPYAAAAIAAgA/gAAAAAAAAAAAAAABoKBAL9LNW5+nkyHZRmyFaL/LJ4xMjM0MjIzNGUCyhgQ9hw6eWAT13EbDa0BAQAAAAAAAACAPtXesZ0BMTIzNDIyMzQAAAAAAgAEAEMAQwABABIARQBMAEkAUwBBAEIARQBUAEgABAAYAGMAYwAuAGkAYwBlAGQAZQB2AC4AbgB1AAMALABlAGwAaQBzAGEAYgBlAHQAaAAuAGMAYwAuAGkAYwBlAGQAZQB2AC4AbgB1AAAAAAAAAAAAdGVzdHVzZXJjdXJsaG9zdA== 122Proxy-Connection: Keep-Alive 123 124GET /path/10080002 HTTP/1.1 125User-Agent: curl/7.12.3-CVS (i686-pc-linux-gnu) libcurl/7.12.3-CVS OpenSSL/0.9.6b zlib/1.1.4 126Host: test.remote.example.com.1008:%HTTPPORT 127Accept: */* 128 129[DISCONNECT] 130</protocol> 131</verify> 132</testcase> 133