test548 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP POST
  6. HTTP proxy
  7. HTTP proxy NTLM auth
  8. </keywords>
  9. </info>
  10. # Server-side
  11. <reply>
  12. <data>
  13. HTTP/1.1 407 Authorization Required swsclose
  14. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  15. Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  16. Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts"
  17. Proxy-Authenticate: NTLM
  18. Content-Type: text/html; charset=iso-8859-1
  19. Connection: close
  20. This is not the real page
  21. </data>
  22. # this is returned first since we get no proxy-auth
  23. <data1001>
  24. HTTP/1.1 407 Authorization Required to proxy me my dear
  25. Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
  26. Content-Length: 34
  27. Hey you, authenticate or go away!
  28. </data1001>
  29. # This is supposed to be returned when the server gets the second
  30. # Authorization: NTLM line passed-in from the client
  31. <data1002>
  32. HTTP/1.1 200 Things are fine in proxy land swsclose
  33. Server: Microsoft-IIS/5.0
  34. Content-Type: text/html; charset=iso-8859-1
  35. Content-Length: 42
  36. Contents of that page you requested, sir.
  37. </data1002>
  38. <datacheck>
  39. HTTP/1.1 407 Authorization Required swsclose
  40. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  41. Proxy-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  42. Proxy-Authenticate: Basic realm="gimme all yer s3cr3ts"
  43. Proxy-Authenticate: NTLM
  44. Content-Type: text/html; charset=iso-8859-1
  45. Connection: close
  46. HTTP/1.1 407 Authorization Required to proxy me my dear
  47. Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
  48. Content-Length: 34
  49. HTTP/1.1 200 Things are fine in proxy land swsclose
  50. Server: Microsoft-IIS/5.0
  51. Content-Type: text/html; charset=iso-8859-1
  52. Content-Length: 42
  53. Contents of that page you requested, sir.
  54. </datacheck>
  55. </reply>
  56. # Client-side
  57. <client>
  58. <server>
  59. http
  60. </server>
  61. # tool to use
  62. <tool>
  63. lib548
  64. </tool>
  65. <features>
  66. NTLM
  67. !SSPI
  68. debug
  69. </features>
  70. <name>
  71. HTTP proxy auth NTLM with POST data from CURLOPT_POSTFIELDS
  72. </name>
  73. <setenv>
  74. # we force our own host name, in order to make the test machine independent
  75. CURL_GETHOSTNAME=curlhost
  76. # we try to use the LD_PRELOAD hack, if not a debug build
  77. LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
  78. </setenv>
  79. <command>
  80. http://test.remote.example.com/path/548 http://%HOSTIP:%HTTPPORT testuser:testpass
  81. </command>
  82. <precheck>
  83. chkhostname curlhost
  84. </precheck>
  85. </client>
  86. # Verify data after the test has been "shot"
  87. <verify>
  88. <strip>
  89. ^User-Agent: curl/.*
  90. </strip>
  91. <protocol>
  92. POST http://test.remote.example.com/path/548 HTTP/1.1
  93. 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
  94. Host: test.remote.example.com
  95. Accept: */*
  96. Proxy-Connection: Keep-Alive
  97. Content-Length: 36
  98. Content-Type: application/x-www-form-urlencoded
  99. this is the blurb we want to upload
  100. POST http://test.remote.example.com/path/548 HTTP/1.1
  101. Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
  102. 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
  103. Host: test.remote.example.com
  104. Accept: */*
  105. Proxy-Connection: Keep-Alive
  106. Content-Length: 0
  107. Content-Type: application/x-www-form-urlencoded
  108. POST http://test.remote.example.com/path/548 HTTP/1.1
  109. Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAACeAJ4AWAAAAAAAAAD2AAAACAAIAPYAAAAIAAgA/gAAAAAAAAAAAAAABoKBAL9LNW5+nkyHZRmyFaL/LJ4xMjM0MjIzNGUCyhgQ9hw6eWAT13EbDa0BAQAAAAAAAACAPtXesZ0BMTIzNDIyMzQAAAAAAgAEAEMAQwABABIARQBMAEkAUwBBAEIARQBUAEgABAAYAGMAYwAuAGkAYwBlAGQAZQB2AC4AbgB1AAMALABlAGwAaQBzAGEAYgBlAHQAaAAuAGMAYwAuAGkAYwBlAGQAZQB2AC4AbgB1AAAAAAAAAAAAdGVzdHVzZXJjdXJsaG9zdA==
  110. 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
  111. Host: test.remote.example.com
  112. Accept: */*
  113. Proxy-Connection: Keep-Alive
  114. Content-Length: 36
  115. Content-Type: application/x-www-form-urlencoded
  116. this is the blurb we want to upload
  117. </protocol>
  118. </verify>
  119. </testcase>