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