test1008 7.2 KB

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