test1412 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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/%TESTNUMBER -u testuser:testpass --anyauth http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001
  85. </command>
  86. <file name="log/put%TESTNUMBER">
  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. <protocol>
  96. GET /%TESTNUMBER HTTP/1.1
  97. Host: %HOSTIP:%HTTPPORT
  98. User-Agent: curl/%VERSION
  99. Accept: */*
  100. GET /%TESTNUMBER HTTP/1.1
  101. Host: %HOSTIP:%HTTPPORT
  102. Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER", response="0390dbe89e31adca0413d11f91f30e7f"
  103. User-Agent: curl/%VERSION
  104. Accept: */*
  105. GET /%TESTNUMBER0001 HTTP/1.1
  106. Host: %HOSTIP:%HTTPPORT
  107. User-Agent: curl/%VERSION
  108. Accept: */*
  109. GET /%TESTNUMBER0001 HTTP/1.1
  110. Host: %HOSTIP:%HTTPPORT
  111. Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER0001", response="0085df91870374c8bf4e94415e7fbf8e"
  112. User-Agent: curl/%VERSION
  113. Accept: */*
  114. </protocol>
  115. </verify>
  116. </testcase>