test2027 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. HTTP Digest auth
  7. </keywords>
  8. </info>
  9. # Server-side
  10. <reply>
  11. <!--
  12. Explanation for the duplicate 400 requests:
  13. libcurl doesn't detect that a given Digest password is wrong already on the
  14. first 401 response (as the data400 gives). libcurl will instead consider the
  15. new response just as a duplicate and it sends another and detects the auth
  16. problem on the second 401 response!
  17. -->
  18. <!-- First request has Digest auth, wrong password -->
  19. <data100>
  20. HTTP/1.1 401 Need Digest auth
  21. Server: Microsoft-IIS/5.0
  22. Content-Type: text/html; charset=iso-8859-1
  23. Content-Length: 27
  24. WWW-Authenticate: Digest realm="testrealm", nonce="1"
  25. This is not the real page!
  26. </data100>
  27. <data1100>
  28. HTTP/1.1 401 Sorry wrong password
  29. Server: Microsoft-IIS/5.0
  30. Content-Type: text/html; charset=iso-8859-1
  31. Content-Length: 29
  32. WWW-Authenticate: Digest realm="testrealm", nonce="2"
  33. This is a bad password page!
  34. </data1100>
  35. <!-- Second request has Digest auth, right password -->
  36. <data200>
  37. HTTP/1.1 401 Need Digest auth (2)
  38. Server: Microsoft-IIS/5.0
  39. Content-Type: text/html; charset=iso-8859-1
  40. Content-Length: 27
  41. WWW-Authenticate: Digest realm="testrealm", nonce="3"
  42. This is not the real page!
  43. </data200>
  44. <data1200>
  45. HTTP/1.1 200 Things are fine in server land
  46. Server: Microsoft-IIS/5.0
  47. Content-Type: text/html; charset=iso-8859-1
  48. Content-Length: 32
  49. Finally, this is the real page!
  50. </data1200>
  51. <!-- Third request has Digest auth, wrong password -->
  52. <data300>
  53. HTTP/1.1 401 Need Digest auth (3)
  54. Server: Microsoft-IIS/5.0
  55. Content-Type: text/html; charset=iso-8859-1
  56. Content-Length: 27
  57. WWW-Authenticate: Digest realm="testrealm", nonce="4"
  58. This is not the real page!
  59. </data300>
  60. <data1300>
  61. HTTP/1.1 401 Sorry wrong password (2)
  62. Server: Microsoft-IIS/5.0
  63. Content-Type: text/html; charset=iso-8859-1
  64. Content-Length: 29
  65. WWW-Authenticate: Digest realm="testrealm", nonce="5"
  66. This is a bad password page!
  67. </data1300>
  68. <!-- Fourth request has Digest auth, wrong password -->
  69. <data400>
  70. HTTP/1.1 401 Need Digest auth (4)
  71. Server: Microsoft-IIS/5.0
  72. Content-Type: text/html; charset=iso-8859-1
  73. Content-Length: 27
  74. WWW-Authenticate: Digest realm="testrealm", nonce="6"
  75. This is not the real page!
  76. </data400>
  77. <data1400>
  78. HTTP/1.1 401 Sorry wrong password (3)
  79. Server: Microsoft-IIS/5.0
  80. Content-Type: text/html; charset=iso-8859-1
  81. Content-Length: 29
  82. WWW-Authenticate: Digest realm="testrealm", nonce="7"
  83. This is a bad password page!
  84. </data1400>
  85. <!-- Fifth request has Digest auth, right password -->
  86. <data1500>
  87. HTTP/1.1 200 Things are fine in server land (2)
  88. Server: Microsoft-IIS/5.0
  89. Content-Type: text/html; charset=iso-8859-1
  90. Content-Length: 32
  91. Finally, this is the real page!
  92. </data1500>
  93. <datacheck>
  94. HTTP/1.1 401 Need Digest auth
  95. Server: Microsoft-IIS/5.0
  96. Content-Type: text/html; charset=iso-8859-1
  97. Content-Length: 27
  98. WWW-Authenticate: Digest realm="testrealm", nonce="1"
  99. HTTP/1.1 401 Sorry wrong password
  100. Server: Microsoft-IIS/5.0
  101. Content-Type: text/html; charset=iso-8859-1
  102. Content-Length: 29
  103. WWW-Authenticate: Digest realm="testrealm", nonce="2"
  104. This is a bad password page!
  105. HTTP/1.1 200 Things are fine in server land
  106. Server: Microsoft-IIS/5.0
  107. Content-Type: text/html; charset=iso-8859-1
  108. Content-Length: 32
  109. Finally, this is the real page!
  110. HTTP/1.1 401 Need Digest auth (3)
  111. Server: Microsoft-IIS/5.0
  112. Content-Type: text/html; charset=iso-8859-1
  113. Content-Length: 27
  114. WWW-Authenticate: Digest realm="testrealm", nonce="4"
  115. HTTP/1.1 401 Sorry wrong password (2)
  116. Server: Microsoft-IIS/5.0
  117. Content-Type: text/html; charset=iso-8859-1
  118. Content-Length: 29
  119. WWW-Authenticate: Digest realm="testrealm", nonce="5"
  120. This is a bad password page!
  121. HTTP/1.1 401 Sorry wrong password (3)
  122. Server: Microsoft-IIS/5.0
  123. Content-Type: text/html; charset=iso-8859-1
  124. Content-Length: 29
  125. WWW-Authenticate: Digest realm="testrealm", nonce="7"
  126. HTTP/1.1 401 Sorry wrong password (3)
  127. Server: Microsoft-IIS/5.0
  128. Content-Type: text/html; charset=iso-8859-1
  129. Content-Length: 29
  130. WWW-Authenticate: Digest realm="testrealm", nonce="7"
  131. This is a bad password page!
  132. HTTP/1.1 200 Things are fine in server land (2)
  133. Server: Microsoft-IIS/5.0
  134. Content-Type: text/html; charset=iso-8859-1
  135. Content-Length: 32
  136. Finally, this is the real page!
  137. </datacheck>
  138. </reply>
  139. # Client-side
  140. <client>
  141. <server>
  142. http
  143. </server>
  144. <tool>
  145. libauthretry
  146. </tool>
  147. <name>
  148. HTTP authorization retry (Digest)
  149. </name>
  150. <setenv>
  151. # we force our own host name, in order to make the test machine independent
  152. CURL_GETHOSTNAME=curlhost
  153. # we try to use the LD_PRELOAD hack, if not a debug build
  154. LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
  155. </setenv>
  156. <command>
  157. http://%HOSTIP:%HTTPPORT/2027 digest digest
  158. </command>
  159. <precheck>
  160. chkhostname curlhost
  161. </precheck>
  162. </client>
  163. # Verify data after the test has been "shot"
  164. <verify>
  165. <strip>
  166. ^User-Agent:.*
  167. </strip>
  168. <protocol>
  169. GET /20270100 HTTP/1.1
  170. Host: %HOSTIP:%HTTPPORT
  171. Accept: */*
  172. GET /20270100 HTTP/1.1
  173. Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/20270100", response="f7fd60eefaff5225971bf9b3d80d6ba6"
  174. Host: %HOSTIP:%HTTPPORT
  175. Accept: */*
  176. GET /20270200 HTTP/1.1
  177. Authorization: Digest username="testuser", realm="testrealm", nonce="2", uri="/20270200", response="785ca3ef511999f7e9c178195f5b388c"
  178. Host: %HOSTIP:%HTTPPORT
  179. Accept: */*
  180. GET /20270300 HTTP/1.1
  181. Host: %HOSTIP:%HTTPPORT
  182. Accept: */*
  183. GET /20270300 HTTP/1.1
  184. Authorization: Digest username="testuser", realm="testrealm", nonce="4", uri="/20270300", response="4c735d2360fd6848e7cb32a11ae3612b"
  185. Host: %HOSTIP:%HTTPPORT
  186. Accept: */*
  187. GET /20270400 HTTP/1.1
  188. Authorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/20270400", response="f5906785511fb60a2af8b1cd53008ead"
  189. Host: %HOSTIP:%HTTPPORT
  190. Accept: */*
  191. GET /20270400 HTTP/1.1
  192. Authorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/20270400", response="f5906785511fb60a2af8b1cd53008ead"
  193. Host: %HOSTIP:%HTTPPORT
  194. Accept: */*
  195. GET /20270500 HTTP/1.1
  196. Authorization: Digest username="testuser", realm="testrealm", nonce="7", uri="/20270500", response="8ef4d935fd964a46c3965c0863b52cf1"
  197. Host: %HOSTIP:%HTTPPORT
  198. Accept: */*
  199. </protocol>
  200. </verify>
  201. </testcase>