test153 3.7 KB

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