test2067 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP POST
  6. HTTP Digest auth
  7. </keywords>
  8. </info>
  9. # Server-side
  10. <reply>
  11. <data>
  12. HTTP/1.1 401 authentication please swsbounce
  13. Server: Microsoft-IIS/6.0
  14. WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-256"
  15. Content-Type: text/html; charset=iso-8859-1
  16. Content-Length: 0
  17. </data>
  18. <data1000>
  19. HTTP/1.1 200 A OK
  20. Server: Microsoft-IIS/6.0
  21. Content-Type: text/html; charset=iso-8859-1
  22. Content-Length: 3
  23. ok
  24. </data1000>
  25. <datacheck>
  26. HTTP/1.1 401 authentication please swsbounce
  27. Server: Microsoft-IIS/6.0
  28. WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-256"
  29. Content-Type: text/html; charset=iso-8859-1
  30. Content-Length: 0
  31. HTTP/1.1 200 A OK
  32. Server: Microsoft-IIS/6.0
  33. Content-Type: text/html; charset=iso-8859-1
  34. Content-Length: 3
  35. ok
  36. </datacheck>
  37. </reply>
  38. # Client-side
  39. <client>
  40. #
  41. <server>
  42. http
  43. </server>
  44. <features>
  45. !SSPI
  46. crypto
  47. </features>
  48. <name>
  49. HTTP POST --digest with SHA256 and user-specified Content-Length header
  50. </name>
  51. # This test is to ensure 'Content-Length: 0' is sent while negotiating auth
  52. # even when there is a user-specified Content-Length header.
  53. # https://github.com/curl/curl/pull/1242
  54. <command>
  55. -H "Content-Length: 11" -u auser:apasswd --digest -d "junkelijunk" http://%HOSTIP:%HTTPPORT/%TESTNUMBER
  56. </command>
  57. </client>
  58. # Verify data after the test has been "shot"
  59. <verify>
  60. <protocol nonewline="yes">
  61. POST /%TESTNUMBER HTTP/1.1
  62. Host: %HOSTIP:%HTTPPORT
  63. User-Agent: curl/%VERSION
  64. Accept: */*
  65. Content-Length: 0
  66. Content-Type: application/x-www-form-urlencoded
  67. POST /%TESTNUMBER HTTP/1.1
  68. Host: %HOSTIP:%HTTPPORT
  69. Authorization: Digest username="auser", realm="testrealm", nonce="1053604144", uri="/%TESTNUMBER", response="67b97af219c92fa7e8685e5bebb8e74892f6c6792e911c52bd2dfbf0b49272eb", algorithm=SHA-256
  70. User-Agent: curl/%VERSION
  71. Accept: */*
  72. Content-Length: 11
  73. Content-Type: application/x-www-form-urlencoded
  74. junkelijunk
  75. </protocol>
  76. </verify>
  77. </testcase>