test548 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. </features>
  68. <name>
  69. HTTP proxy auth NTLM with POST data from CURLOPT_POSTFIELDS
  70. </name>
  71. <setenv>
  72. # we force our own host name, in order to make the test machine independent
  73. CURL_GETHOSTNAME=curlhost
  74. # we try to use the LD_PRELOAD hack, if not a debug build
  75. LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
  76. </setenv>
  77. <command>
  78. http://test.remote.example.com/path/548 http://%HOSTIP:%HTTPPORT s1lly:pers0n
  79. </command>
  80. <precheck>
  81. chkhostname curlhost
  82. </precheck>
  83. </client>
  84. # Verify data after the test has been "shot"
  85. <verify>
  86. <strip>
  87. ^User-Agent: curl/.*
  88. </strip>
  89. <protocol>
  90. POST http://test.remote.example.com/path/548 HTTP/1.1
  91. 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
  92. Host: test.remote.example.com
  93. Accept: */*
  94. Proxy-Connection: Keep-Alive
  95. Content-Length: 36
  96. Content-Type: application/x-www-form-urlencoded
  97. this is the blurb we want to upload
  98. POST http://test.remote.example.com/path/548 HTTP/1.1
  99. Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
  100. 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
  101. Host: test.remote.example.com
  102. Accept: */*
  103. Proxy-Connection: Keep-Alive
  104. Content-Length: 0
  105. Content-Type: application/x-www-form-urlencoded
  106. POST http://test.remote.example.com/path/548 HTTP/1.1
  107. Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAABQAFAHAAAAAIAAgAdQAAAAAAAAAAAAAABoKBAIYrD1xJmhNBNL9fLzuk9PV9436GAxPu0EKWzqQ/sZDVLXnp1JrySgl8A+cibE6z4HMxbGx5Y3VybGhvc3Q=
  108. 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
  109. Host: test.remote.example.com
  110. Accept: */*
  111. Proxy-Connection: Keep-Alive
  112. Content-Length: 36
  113. Content-Type: application/x-www-form-urlencoded
  114. this is the blurb we want to upload
  115. </protocol>
  116. </verify>
  117. </testcase>