test153 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. # First reply back and ask for Digest auth
  12. <data1>
  13. HTTP/1.1 401 Authorization Required swsclose
  14. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  15. WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
  16. Content-Type: text/html; charset=iso-8859-1
  17. Content-Length: 26
  18. This is not the real page
  19. </data1>
  20. # second reply back
  21. <data2>
  22. HTTP/1.1 401 Authorization Required swsclose
  23. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  24. WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
  25. Content-Type: text/html; charset=iso-8859-1
  26. Content-Length: 26
  27. This is not the real page
  28. </data2>
  29. # This is supposed to be returned when the server gets a
  30. # Authorization: Digest line passed-in from the client
  31. <data1001>
  32. HTTP/1.1 200 OK
  33. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  34. Content-Type: text/html; charset=iso-8859-1
  35. Content-Length: 23
  36. This IS the real page!
  37. </data1001>
  38. #
  39. # This is the second request, and this sends back a response saying that
  40. # the request contained stale data. We want an update. Set swsbounce to
  41. # bounce on to data1003 on the second request.
  42. <data1002>
  43. HTTP/1.1 401 Authorization re-negotiation please swsbounce
  44. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  45. WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth"
  46. Content-Type: text/html; charset=iso-8859-1
  47. Content-Length: 26
  48. This is not the real page
  49. </data1002>
  50. # The second request to the 1002 section will bounce this one back instead
  51. # thanks to the swsbounce keyword up there
  52. <data1003>
  53. HTTP/1.1 200 OK
  54. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  55. Content-Type: text/html; charset=iso-8859-1
  56. Content-Length: 30
  57. This IS the second real page!
  58. </data1003>
  59. </reply>
  60. # Client-side
  61. <client>
  62. <server>
  63. http
  64. </server>
  65. <features>
  66. !SSPI
  67. crypto
  68. </features>
  69. <name>
  70. HTTP with Digest authorization with stale=true
  71. </name>
  72. <command>
  73. http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 -u testuser:testpass --digest http://%HOSTIP:%HTTPPORT/%TESTNUMBER0002
  74. </command>
  75. </client>
  76. # Verify data after the test has been "shot"
  77. <verify>
  78. <strip>
  79. ^Authorization.*cnonce
  80. </strip>
  81. <protocol>
  82. GET /%TESTNUMBER0001 HTTP/1.1
  83. Host: %HOSTIP:%HTTPPORT
  84. User-Agent: curl/%VERSION
  85. Accept: */*
  86. GET /%TESTNUMBER0001 HTTP/1.1
  87. Host: %HOSTIP:%HTTPPORT
  88. Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER0001", response="f4f83139396995bac665f24a1f1055c7"
  89. User-Agent: curl/%VERSION
  90. Accept: */*
  91. GET /%TESTNUMBER0002 HTTP/1.1
  92. Host: %HOSTIP:%HTTPPORT
  93. User-Agent: curl/%VERSION
  94. Accept: */*
  95. GET /%TESTNUMBER0002 HTTP/1.1
  96. Host: %HOSTIP:%HTTPPORT
  97. Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/%TESTNUMBER0002", response="f84511b014fdd0ba6494f42871079c32"
  98. User-Agent: curl/%VERSION
  99. Accept: */*
  100. GET /%TESTNUMBER0002 HTTP/1.1
  101. Host: %HOSTIP:%HTTPPORT
  102. Authorization: Digest username="testuser", realm="testrealm", nonce="999999", uri="/%TESTNUMBER0002", cnonce="MTA4MzIy", nc="00000001", qop="auth", response="25291c357671604a16c0242f56721c07", algorithm=MD5
  103. User-Agent: curl/%VERSION
  104. Accept: */*
  105. </protocol>
  106. <stdout>
  107. HTTP/1.1 401 Authorization Required swsclose
  108. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  109. WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
  110. Content-Type: text/html; charset=iso-8859-1
  111. Content-Length: 26
  112. HTTP/1.1 200 OK
  113. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  114. Content-Type: text/html; charset=iso-8859-1
  115. Content-Length: 23
  116. This IS the real page!
  117. HTTP/1.1 401 Authorization Required swsclose
  118. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  119. WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
  120. Content-Type: text/html; charset=iso-8859-1
  121. Content-Length: 26
  122. HTTP/1.1 401 Authorization re-negotiation please swsbounce
  123. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  124. WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth"
  125. Content-Type: text/html; charset=iso-8859-1
  126. Content-Length: 26
  127. HTTP/1.1 200 OK
  128. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  129. Content-Type: text/html; charset=iso-8859-1
  130. Content-Length: 30
  131. This IS the second real page!
  132. </stdout>
  133. </verify>
  134. </testcase>