test153 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. crypto
  58. </features>
  59. <name>
  60. HTTP with Digest authorization with stale=true
  61. </name>
  62. <command>
  63. http://%HOSTIP:%HTTPPORT/1530001 -u testuser:testpass --digest http://%HOSTIP:%HTTPPORT/1530002
  64. </command>
  65. </client>
  66. # Verify data after the test has been "shot"
  67. <verify>
  68. <strip>
  69. ^Authorization.*cnonce
  70. ^User-Agent:.*
  71. </strip>
  72. <protocol>
  73. GET /1530001 HTTP/1.1
  74. Host: %HOSTIP:%HTTPPORT
  75. Accept: */*
  76. GET /1530001 HTTP/1.1
  77. Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/1530001", response="f4f83139396995bac665f24a1f1055c7"
  78. User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
  79. Host: %HOSTIP:%HTTPPORT
  80. Accept: */*
  81. GET /1530002 HTTP/1.1
  82. Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/1530002", response="f84511b014fdd0ba6494f42871079c32"
  83. 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
  84. Host: %HOSTIP:%HTTPPORT
  85. Accept: */*
  86. GET /1530002 HTTP/1.1
  87. Authorization: Digest username="testuser", realm="testrealm", nonce="999999", uri="/1530002", cnonce="MTA4MzIy", nc="00000001", qop="auth", response="25291c357671604a16c0242f56721c07", algorithm="MD5"
  88. 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
  89. Host: %HOSTIP:%HTTPPORT
  90. Accept: */*
  91. </protocol>
  92. <stdout>
  93. HTTP/1.1 401 Authorization Required swsclose
  94. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  95. WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
  96. Content-Type: text/html; charset=iso-8859-1
  97. Content-Length: 26
  98. HTTP/1.1 200 OK
  99. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  100. Content-Type: text/html; charset=iso-8859-1
  101. Content-Length: 23
  102. This IS the real page!
  103. HTTP/1.1 401 Authorization re-negotiation please swsbounce
  104. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  105. WWW-Authenticate: Digest realm="testrealm", algorithm=MD5, nonce="999999", stale=true, qop="auth"
  106. Content-Type: text/html; charset=iso-8859-1
  107. Content-Length: 25
  108. HTTP/1.1 200 OK
  109. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  110. Content-Type: text/html; charset=iso-8859-1
  111. Content-Length: 30
  112. This IS the second real page!
  113. </stdout>
  114. </verify>
  115. </testcase>