113498266Sopenharmony_ci<testcase>
213498266Sopenharmony_ci<info>
313498266Sopenharmony_ci<keywords>
413498266Sopenharmony_ciHTTP
513498266Sopenharmony_ciHTTP GET
613498266Sopenharmony_ciHTTP Basic auth
713498266Sopenharmony_ciHTTP Digest auth
813498266Sopenharmony_ci</keywords>
913498266Sopenharmony_ci</info>
1013498266Sopenharmony_ci# Server-side
1113498266Sopenharmony_ci<reply>
1213498266Sopenharmony_ci
1313498266Sopenharmony_ci<!-- Alternate the order that Basic and Digest headers appear in responses to
1413498266Sopenharmony_ciensure that the order doesn't matter. -->
1513498266Sopenharmony_ci
1613498266Sopenharmony_ci<!-- First request has Basic auth, wrong password -->
1713498266Sopenharmony_ci<data100>
1813498266Sopenharmony_ciHTTP/1.1 401 Sorry wrong password
1913498266Sopenharmony_ciServer: Microsoft-IIS/5.0
2013498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
2113498266Sopenharmony_ciContent-Length: 29
2213498266Sopenharmony_ciWWW-Authenticate: Digest realm="testrealm", nonce="1"
2313498266Sopenharmony_ciWWW-Authenticate: Basic realm="testrealm"
2413498266Sopenharmony_ci
2513498266Sopenharmony_ciThis is a bad password page!
2613498266Sopenharmony_ci</data100>
2713498266Sopenharmony_ci
2813498266Sopenharmony_ci<!-- Second request has Digest auth, right password -->
2913498266Sopenharmony_ci<data1200>
3013498266Sopenharmony_ciHTTP/1.1 200 Things are fine in server land
3113498266Sopenharmony_ciServer: Microsoft-IIS/5.0
3213498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
3313498266Sopenharmony_ciContent-Length: 32
3413498266Sopenharmony_ci
3513498266Sopenharmony_ciFinally, this is the real page!
3613498266Sopenharmony_ci</data1200>
3713498266Sopenharmony_ci
3813498266Sopenharmony_ci<!-- Third request has Basic auth, wrong password -->
3913498266Sopenharmony_ci<data300>
4013498266Sopenharmony_ciHTTP/1.1 401 Sorry wrong password (2)
4113498266Sopenharmony_ciServer: Microsoft-IIS/5.0
4213498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
4313498266Sopenharmony_ciContent-Length: 29
4413498266Sopenharmony_ciWWW-Authenticate: Digest realm="testrealm", nonce="2"
4513498266Sopenharmony_ciWWW-Authenticate: Basic realm="testrealm"
4613498266Sopenharmony_ci
4713498266Sopenharmony_ciThis is a bad password page!
4813498266Sopenharmony_ci</data300>
4913498266Sopenharmony_ci
5013498266Sopenharmony_ci<!-- Fourth request has Digest auth, wrong password -->
5113498266Sopenharmony_ci<data1400>
5213498266Sopenharmony_ciHTTP/1.1 401 Sorry wrong password (3)
5313498266Sopenharmony_ciServer: Microsoft-IIS/5.0
5413498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
5513498266Sopenharmony_ciContent-Length: 29
5613498266Sopenharmony_ciWWW-Authenticate: Digest realm="testrealm", nonce="3"
5713498266Sopenharmony_ciWWW-Authenticate: Basic realm="testrealm"
5813498266Sopenharmony_ci
5913498266Sopenharmony_ciThis is a bad password page!
6013498266Sopenharmony_ci</data1400>
6113498266Sopenharmony_ci
6213498266Sopenharmony_ci<!-- Fifth request has Digest auth, right password -->
6313498266Sopenharmony_ci<data1500>
6413498266Sopenharmony_ciHTTP/1.1 200 Things are fine in server land (2)
6513498266Sopenharmony_ciServer: Microsoft-IIS/5.0
6613498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
6713498266Sopenharmony_ciContent-Length: 32
6813498266Sopenharmony_ci
6913498266Sopenharmony_ciFinally, this is the real page!
7013498266Sopenharmony_ci</data1500>
7113498266Sopenharmony_ci
7213498266Sopenharmony_ci<datacheck>
7313498266Sopenharmony_ciHTTP/1.1 401 Sorry wrong password
7413498266Sopenharmony_ciServer: Microsoft-IIS/5.0
7513498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
7613498266Sopenharmony_ciContent-Length: 29
7713498266Sopenharmony_ciWWW-Authenticate: Digest realm="testrealm", nonce="1"
7813498266Sopenharmony_ciWWW-Authenticate: Basic realm="testrealm"
7913498266Sopenharmony_ci
8013498266Sopenharmony_ciThis is a bad password page!
8113498266Sopenharmony_ciHTTP/1.1 200 Things are fine in server land
8213498266Sopenharmony_ciServer: Microsoft-IIS/5.0
8313498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
8413498266Sopenharmony_ciContent-Length: 32
8513498266Sopenharmony_ci
8613498266Sopenharmony_ciFinally, this is the real page!
8713498266Sopenharmony_ciHTTP/1.1 401 Sorry wrong password (2)
8813498266Sopenharmony_ciServer: Microsoft-IIS/5.0
8913498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
9013498266Sopenharmony_ciContent-Length: 29
9113498266Sopenharmony_ciWWW-Authenticate: Digest realm="testrealm", nonce="2"
9213498266Sopenharmony_ciWWW-Authenticate: Basic realm="testrealm"
9313498266Sopenharmony_ci
9413498266Sopenharmony_ciThis is a bad password page!
9513498266Sopenharmony_ciHTTP/1.1 401 Sorry wrong password (3)
9613498266Sopenharmony_ciServer: Microsoft-IIS/5.0
9713498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
9813498266Sopenharmony_ciContent-Length: 29
9913498266Sopenharmony_ciWWW-Authenticate: Digest realm="testrealm", nonce="3"
10013498266Sopenharmony_ciWWW-Authenticate: Basic realm="testrealm"
10113498266Sopenharmony_ci
10213498266Sopenharmony_ciThis is a bad password page!
10313498266Sopenharmony_ciHTTP/1.1 200 Things are fine in server land (2)
10413498266Sopenharmony_ciServer: Microsoft-IIS/5.0
10513498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
10613498266Sopenharmony_ciContent-Length: 32
10713498266Sopenharmony_ci
10813498266Sopenharmony_ciFinally, this is the real page!
10913498266Sopenharmony_ci</datacheck>
11013498266Sopenharmony_ci
11113498266Sopenharmony_ci</reply>
11213498266Sopenharmony_ci
11313498266Sopenharmony_ci# Client-side
11413498266Sopenharmony_ci<client>
11513498266Sopenharmony_ci<server>
11613498266Sopenharmony_cihttp
11713498266Sopenharmony_ci</server>
11813498266Sopenharmony_ci<features>
11913498266Sopenharmony_ci!SSPI
12013498266Sopenharmony_cicrypto
12113498266Sopenharmony_ci</features>
12213498266Sopenharmony_ci<tool>
12313498266Sopenharmony_cilibauthretry
12413498266Sopenharmony_ci</tool>
12513498266Sopenharmony_ci
12613498266Sopenharmony_ci<name>
12713498266Sopenharmony_ciHTTP authorization retry (Basic switching to Digest)
12813498266Sopenharmony_ci</name>
12913498266Sopenharmony_ci <setenv>
13013498266Sopenharmony_ci# we force our own host name, in order to make the test machine independent
13113498266Sopenharmony_ciCURL_GETHOSTNAME=curlhost
13213498266Sopenharmony_ci# we try to use the LD_PRELOAD hack, if not a debug build
13313498266Sopenharmony_ciLD_PRELOAD=%PWD/libtest/.libs/libhostname.so
13413498266Sopenharmony_ci </setenv>
13513498266Sopenharmony_ci<command>
13613498266Sopenharmony_cihttp://%HOSTIP:%HTTPPORT/%TESTNUMBER basic digest
13713498266Sopenharmony_ci</command>
13813498266Sopenharmony_ci<precheck>
13913498266Sopenharmony_cichkhostname curlhost
14013498266Sopenharmony_ci</precheck>
14113498266Sopenharmony_ci</client>
14213498266Sopenharmony_ci
14313498266Sopenharmony_ci# Verify data after the test has been "shot"
14413498266Sopenharmony_ci<verify>
14513498266Sopenharmony_ci<protocol>
14613498266Sopenharmony_ciGET /%TESTNUMBER0100 HTTP/1.1
14713498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT
14813498266Sopenharmony_ciAuthorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz
14913498266Sopenharmony_ciAccept: */*
15013498266Sopenharmony_ci
15113498266Sopenharmony_ciGET /%TESTNUMBER0200 HTTP/1.1
15213498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT
15313498266Sopenharmony_ciAuthorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/%TESTNUMBER0200", response="ed646c565f79e2dd9fa37cb5a621213c"
15413498266Sopenharmony_ciAccept: */*
15513498266Sopenharmony_ci
15613498266Sopenharmony_ciGET /%TESTNUMBER0300 HTTP/1.1
15713498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT
15813498266Sopenharmony_ciAuthorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz
15913498266Sopenharmony_ciAccept: */*
16013498266Sopenharmony_ci
16113498266Sopenharmony_ciGET /%TESTNUMBER0400 HTTP/1.1
16213498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT
16313498266Sopenharmony_ciAuthorization: Digest username="testuser", realm="testrealm", nonce="2", uri="/%TESTNUMBER0400", response="9741ced8caacc6124770187b36f007c5"
16413498266Sopenharmony_ciAccept: */*
16513498266Sopenharmony_ci
16613498266Sopenharmony_ciGET /%TESTNUMBER0500 HTTP/1.1
16713498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT
16813498266Sopenharmony_ciAuthorization: Digest username="testuser", realm="testrealm", nonce="3", uri="/%TESTNUMBER0500", response="5bc77ec8c2d443b27a1b55f1fd8fbb13"
16913498266Sopenharmony_ciAccept: */*
17013498266Sopenharmony_ci
17113498266Sopenharmony_ci</protocol>
17213498266Sopenharmony_ci</verify>
17313498266Sopenharmony_ci</testcase>
174