<?xml version="1.0" encoding="US-ASCII"?>
<testcase>
<info>
<keywords>
HTTP
HTTP GET
Digest
auth
libtest
</keywords>
</info>

# In a build without MD5 support, a Digest challenge that lists nonce
# before algorithm=MD5 is declined. The half-parsed challenge state must
# be cleaned up: a second transfer on the same handle (same origin) that
# is offered a SHA-256 challenge must be sent and authenticate normally.
# Before the fix, the second transfer was never sent and failed with
# error 61 (CURLE_BAD_CONTENT_ENCODING).
#
# The challenges carry no qop so that the authenticated request can be
# verified exactly (same style as test2067).

<reply>
<data1 crlf="headers">
HTTP/1.1 401 authentication please
Server: Apache/1.3.27 (Darwin) mod_ssl/2.8.12 OpenSSL/0.9.6b
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm=MD5
Content-Type: text/html; charset=iso-8859-1
Content-Length: 0

</data1>
<data2 crlf="headers">
HTTP/1.1 401 authentication please
Server: Apache/1.3.27 (Darwin) mod_ssl/2.8.12 OpenSSL/0.9.6b
WWW-Authenticate: Digest realm="testrealm", nonce="2053604144", algorithm=SHA-256
Content-Type: text/html; charset=iso-8859-1
Content-Length: 0

</data2>
<data1002 crlf="headers">
HTTP/1.1 200 A OK
Server: Apache/1.3.27 (Darwin) mod_ssl/2.8.12 OpenSSL/0.9.6b
Content-Type: text/html; charset=iso-8859-1
Content-Length: 3

ok
</data1002>
</reply>

<client>
<server>
http
</server>
<features>
!SSPI
crypto
digest
!md5
sha256
</features>
<name>
HTTP Digest: declined MD5 challenge does not break later transfers
</name>
<command>
http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 http://%HOSTIP:%HTTPPORT/%TESTNUMBER0002
</command>
</client>

<verify>
<protocol crlf="headers">
GET /%TESTNUMBER0001 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /%TESTNUMBER0002 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*

GET /%TESTNUMBER0002 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Authorization: Digest username="user", realm="testrealm", nonce="2053604144", uri="/%TESTNUMBER0002", response="3e194b746e02aaa3c438052580624ef43a2300a3a5de780d378a9355b8591b7d", algorithm=SHA-256
Accept: */*

</protocol>
</verify>
</testcase>
