2012-11-04 17:48:52 -05:00
<testcase>
<info>
<keywords>
HTTP
HTTP GET
HTTP Digest auth
--anyauth
</keywords>
</info>
# Server-side
<reply>
<servercmd>
auth_required
</servercmd>
<data>
HTTP/1.1 401 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
Content-Type: text/html; charset=iso-8859-1
Connection: close
This is not the real page
</data>
2019-07-20 13:14:00 -04:00
# The second URL will get this response
<data1>
HTTP/1.1 401 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
Content-Type: text/html; charset=iso-8859-1
Connection: close
This is not the real page
</data1>
2012-11-04 17:48:52 -05:00
# This is supposed to be returned when the server gets a
# Authorization: Digest line passed-in from the client
<data1000>
HTTP/1.1 200 OK swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Content-Type: text/html; charset=iso-8859-1
Content-Length: 23
Connection: close
This IS the real page!
</data1000>
# This is the second request
<data1001>
HTTP/1.1 200 OK swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Content-Type: text/html; charset=iso-8859-1
Content-Length: 23
Connection: close
This IS the second real page!
</data1001>
<datacheck>
HTTP/1.1 401 Authorization Required swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
Content-Type: text/html; charset=iso-8859-1
Connection: close
HTTP/1.1 200 OK swsclose
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
Content-Type: text/html; charset=iso-8859-1
Content-Length: 23
Connection: close
This IS the real page!
</datacheck>
</reply>
# Client-side
<client>
<server>
http
</server>
<features>
2014-11-06 14:57:16 -05:00
!SSPI
2012-11-04 17:48:52 -05:00
crypto
</features>
<name>
HTTP GET with --anyauth with two URLs (picking Digest)
</name>
<command>
2021-03-12 11:38:26 -05:00
http://%HOSTIP:%HTTPPORT/%TESTNUMBER -u testuser:testpass --anyauth http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001
2012-11-04 17:48:52 -05:00
</command>
2021-03-12 11:38:26 -05:00
<file name="log/put%TESTNUMBER">
2012-11-04 17:48:52 -05:00
This is data we upload with PUT
a second line
line three
four is the number of lines
</file>
</client>
# Verify data after the test has been "shot"
<verify>
<protocol>
2021-03-12 11:38:26 -05:00
GET /%TESTNUMBER HTTP/1.1
2012-11-04 17:48:52 -05:00
Host: %HOSTIP:%HTTPPORT
2020-10-02 07:45:24 -04:00
User-Agent: curl/%VERSION
2012-11-04 17:48:52 -05:00
Accept: */*
2021-03-12 11:38:26 -05:00
GET /%TESTNUMBER HTTP/1.1
2015-03-11 19:50:46 -04:00
Host: %HOSTIP:%HTTPPORT
2021-03-12 11:38:26 -05:00
Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER", response="0390dbe89e31adca0413d11f91f30e7f"
2020-10-02 07:45:24 -04:00
User-Agent: curl/%VERSION
2012-11-04 17:48:52 -05:00
Accept: */*
2021-03-12 11:38:26 -05:00
GET /%TESTNUMBER0001 HTTP/1.1
2019-07-20 13:14:00 -04:00
Host: %HOSTIP:%HTTPPORT
2020-10-02 07:45:24 -04:00
User-Agent: curl/%VERSION
2019-07-20 13:14:00 -04:00
Accept: */*
2021-03-12 11:38:26 -05:00
GET /%TESTNUMBER0001 HTTP/1.1
2015-03-11 19:50:46 -04:00
Host: %HOSTIP:%HTTPPORT
2021-03-12 11:38:26 -05:00
Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER0001", response="0085df91870374c8bf4e94415e7fbf8e"
2020-10-02 07:45:24 -04:00
User-Agent: curl/%VERSION
2012-11-04 17:48:52 -05:00
Accept: */*
</protocol>
</verify>
</testcase>