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