- I removed the default use of "Pragma: no-cache" from libcurl when a proxy is
[platform/upstream/curl.git] / tests / data / test243
1 <testcase>
2 <info>
3 <keywords>
4 HTTP
5 HTTP GET
6 HTTP proxy
7 HTTP proxy NTLM auth
8 --proxy-anyauth
9 </keywords>
10 </info>
11
12 # Server-side
13 <reply>
14
15 <data>
16 HTTP/1.1 407 Authorization Required swsclose\r
17 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
18 Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"\r
19 Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts"\r
20 Proxy-Authenticate: NTLM\r
21 Content-Type: text/html; charset=iso-8859-1\r
22 Connection: close\r
23 \r
24 This is not the real page
25 </data>
26
27 # this is returned first since we get no proxy-auth
28 <data1001>
29 HTTP/1.1 407 Authorization Required to proxy me my dear\r
30 Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==\r
31 Content-Length: 34\r
32 \r
33 Hey you, authenticate or go away!
34 </data1001>
35
36 # This is supposed to be returned when the server gets the second
37 # Authorization: NTLM line passed-in from the client
38 <data1002>
39 HTTP/1.1 200 Things are fine in proxy land swsclose\r
40 Server: Microsoft-IIS/5.0\r
41 Content-Type: text/html; charset=iso-8859-1\r
42 Content-Length: 42\r
43 \r
44 Contents of that page you requested, sir.
45 </data1002>
46
47 <datacheck>
48 HTTP/1.1 407 Authorization Required swsclose\r
49 Server: Apache/1.3.27 (Darwin) PHP/4.1.2\r
50 Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"\r
51 Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts"\r
52 Proxy-Authenticate: NTLM\r
53 Content-Type: text/html; charset=iso-8859-1\r
54 Connection: close\r
55 \r
56 HTTP/1.1 407 Authorization Required to proxy me my dear\r
57 Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==\r
58 Content-Length: 34\r
59 \r
60 HTTP/1.1 200 Things are fine in proxy land swsclose\r
61 Server: Microsoft-IIS/5.0\r
62 Content-Type: text/html; charset=iso-8859-1\r
63 Content-Length: 42\r
64 \r
65 Contents of that page you requested, sir.
66 </datacheck>
67 </reply>
68
69 # Client-side
70 <client>
71 <server>
72 http
73 </server>
74 <features>
75 NTLM
76 </features>
77  <name>
78 HTTP POST with --proxy-anyauth, picking NTLM
79  </name>
80  <command>
81 http://%HOSTIP:%HTTPPORT/243 --proxy http://%HOSTIP:%HTTPPORT --proxy-user silly:person --proxy-anyauth -d "postit"
82 </command>
83 </client>
84
85 # Verify data after the test has been "shot"
86 <verify>
87 <strip>
88 ^User-Agent: curl/.*
89 </strip>
90 # We strip off a large chunk of the type-2 NTLM message since it depends on
91 # the local host name and thus differs on different machines!
92 <strippart>
93 s/^(Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAABQAFAHAAAAA).*/$1/
94 </strippart>
95 <protocol nonewline="yes">
96 POST http://%HOSTIP:%HTTPPORT/243 HTTP/1.1\r
97 User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13\r
98 Host: %HOSTIP:%HTTPPORT\r
99 Accept: */*\r
100 Proxy-Connection: Keep-Alive\r
101 Content-Length: 6\r
102 Content-Type: application/x-www-form-urlencoded\r
103 \r
104 postitPOST http://%HOSTIP:%HTTPPORT/243 HTTP/1.1\r
105 Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=\r
106 User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13\r
107 Host: %HOSTIP:%HTTPPORT\r
108 Accept: */*\r
109 Proxy-Connection: Keep-Alive\r
110 Content-Length: 0\r
111 Content-Type: application/x-www-form-urlencoded\r
112 \r
113 POST http://%HOSTIP:%HTTPPORT/243 HTTP/1.1\r
114 Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAABQAFAHAAAAA
115 User-Agent: curl/7.13.2-CVS (i686-pc-linux-gnu) libcurl/7.13.2-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13\r
116 Host: %HOSTIP:%HTTPPORT\r
117 Accept: */*\r
118 Proxy-Connection: Keep-Alive\r
119 Content-Length: 6\r
120 Content-Type: application/x-www-form-urlencoded\r
121 \r
122 postit
123 </protocol>
124 </verify>
125 </testcase>