test1412 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. HTTP Digest auth
  7. --anyauth
  8. </keywords>
  9. </info>
  10. # Server-side
  11. <reply>
  12. <servercmd>
  13. auth_required
  14. </servercmd>
  15. <data>
  16. HTTP/1.1 401 Authorization Required swsclose
  17. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  18. WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  19. WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
  20. WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
  21. Content-Type: text/html; charset=iso-8859-1
  22. Connection: close
  23. This is not the real page
  24. </data>
  25. # The second URL will get this response
  26. <data1>
  27. HTTP/1.1 401 Authorization Required swsclose
  28. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  29. WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  30. WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
  31. WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
  32. Content-Type: text/html; charset=iso-8859-1
  33. Connection: close
  34. This is not the real page
  35. </data1>
  36. # This is supposed to be returned when the server gets a
  37. # Authorization: Digest line passed-in from the client
  38. <data1000>
  39. HTTP/1.1 200 OK swsclose
  40. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  41. Content-Type: text/html; charset=iso-8859-1
  42. Content-Length: 23
  43. Connection: close
  44. This IS the real page!
  45. </data1000>
  46. # This is the second request
  47. <data1001>
  48. HTTP/1.1 200 OK swsclose
  49. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  50. Content-Type: text/html; charset=iso-8859-1
  51. Content-Length: 23
  52. Connection: close
  53. This IS the second real page!
  54. </data1001>
  55. <datacheck>
  56. HTTP/1.1 401 Authorization Required swsclose
  57. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  58. WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  59. WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
  60. WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
  61. Content-Type: text/html; charset=iso-8859-1
  62. Connection: close
  63. HTTP/1.1 200 OK swsclose
  64. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  65. Content-Type: text/html; charset=iso-8859-1
  66. Content-Length: 23
  67. Connection: close
  68. This IS the real page!
  69. </datacheck>
  70. </reply>
  71. # Client-side
  72. <client>
  73. <server>
  74. http
  75. </server>
  76. <features>
  77. !SSPI
  78. crypto
  79. </features>
  80. <name>
  81. HTTP GET with --anyauth with two URLs (picking Digest)
  82. </name>
  83. <command>
  84. http://%HOSTIP:%HTTPPORT/1412 -u testuser:testpass --anyauth http://%HOSTIP:%HTTPPORT/14120001
  85. </command>
  86. <file name="log/put1412">
  87. This is data we upload with PUT
  88. a second line
  89. line three
  90. four is the number of lines
  91. </file>
  92. </client>
  93. # Verify data after the test has been "shot"
  94. <verify>
  95. <strip>
  96. ^User-Agent:.*
  97. </strip>
  98. <protocol>
  99. GET /1412 HTTP/1.1
  100. Host: %HOSTIP:%HTTPPORT
  101. Accept: */*
  102. GET /1412 HTTP/1.1
  103. Host: %HOSTIP:%HTTPPORT
  104. Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/1412", response="0390dbe89e31adca0413d11f91f30e7f"
  105. User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
  106. Accept: */*
  107. GET /14120001 HTTP/1.1
  108. Host: %HOSTIP:%HTTPPORT
  109. User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
  110. Accept: */*
  111. GET /14120001 HTTP/1.1
  112. Host: %HOSTIP:%HTTPPORT
  113. Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/14120001", response="0085df91870374c8bf4e94415e7fbf8e"
  114. User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
  115. Accept: */*
  116. </protocol>
  117. </verify>
  118. </testcase>