113498266Sopenharmony_ci<testcase> 213498266Sopenharmony_ci<info> 313498266Sopenharmony_ci<keywords> 413498266Sopenharmony_ciHTTP 513498266Sopenharmony_ciHTTP GET 613498266Sopenharmony_ciHTTP Digest auth 713498266Sopenharmony_ci</keywords> 813498266Sopenharmony_ci</info> 913498266Sopenharmony_ci# Server-side 1013498266Sopenharmony_ci<reply> 1113498266Sopenharmony_ci 1213498266Sopenharmony_ci<!-- 1313498266Sopenharmony_ci 1413498266Sopenharmony_ci Explanation for the duplicate 400 requests: 1513498266Sopenharmony_ci 1613498266Sopenharmony_ci libcurl doesn't detect that a given Digest password is wrong already on the 1713498266Sopenharmony_ci first 401 response (as the data400 gives). libcurl will instead consider the 1813498266Sopenharmony_ci new response just as a duplicate and it sends another and detects the auth 1913498266Sopenharmony_ci problem on the second 401 response! 2013498266Sopenharmony_ci 2113498266Sopenharmony_ci--> 2213498266Sopenharmony_ci 2313498266Sopenharmony_ci<!-- First request has Digest auth, wrong password --> 2413498266Sopenharmony_ci<data100> 2513498266Sopenharmony_ciHTTP/1.1 401 Need Digest auth 2613498266Sopenharmony_ciServer: Microsoft-IIS/5.0 2713498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1 2813498266Sopenharmony_ciContent-Length: 27 2913498266Sopenharmony_ciWWW-Authenticate: Digest realm="testrealm", nonce="1" 3013498266Sopenharmony_ci 3113498266Sopenharmony_ciThis is not the real page! 3213498266Sopenharmony_ci</data100> 3313498266Sopenharmony_ci 3413498266Sopenharmony_ci<data1100> 3513498266Sopenharmony_ciHTTP/1.1 401 Sorry wrong password 3613498266Sopenharmony_ciServer: Microsoft-IIS/5.0 3713498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1 3813498266Sopenharmony_ciContent-Length: 29 3913498266Sopenharmony_ciWWW-Authenticate: Digest realm="testrealm", nonce="2" 4013498266Sopenharmony_ci 4113498266Sopenharmony_ciThis is a bad password page! 4213498266Sopenharmony_ci</data1100> 4313498266Sopenharmony_ci 4413498266Sopenharmony_ci<!-- Second request has Digest auth, right password --> 4513498266Sopenharmony_ci<data200> 4613498266Sopenharmony_ciHTTP/1.1 401 Need Digest auth (2) 4713498266Sopenharmony_ciServer: Microsoft-IIS/5.0 4813498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1 4913498266Sopenharmony_ciContent-Length: 27 5013498266Sopenharmony_ciWWW-Authenticate: Digest realm="testrealm", nonce="3" 5113498266Sopenharmony_ci 5213498266Sopenharmony_ciThis is not the real page! 5313498266Sopenharmony_ci</data200> 5413498266Sopenharmony_ci 5513498266Sopenharmony_ci<data1200> 5613498266Sopenharmony_ciHTTP/1.1 200 Things are fine in server land 5713498266Sopenharmony_ciServer: Microsoft-IIS/5.0 5813498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1 5913498266Sopenharmony_ciContent-Length: 32 6013498266Sopenharmony_ci 6113498266Sopenharmony_ciFinally, this is the real page! 6213498266Sopenharmony_ci</data1200> 6313498266Sopenharmony_ci 6413498266Sopenharmony_ci<!-- Third request has Digest auth, wrong password --> 6513498266Sopenharmony_ci<data300> 6613498266Sopenharmony_ciHTTP/1.1 401 Need Digest auth (3) 6713498266Sopenharmony_ciServer: Microsoft-IIS/5.0 6813498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1 6913498266Sopenharmony_ciContent-Length: 27 7013498266Sopenharmony_ciWWW-Authenticate: Digest realm="testrealm", nonce="4" 7113498266Sopenharmony_ci 7213498266Sopenharmony_ciThis is not the real page! 7313498266Sopenharmony_ci</data300> 7413498266Sopenharmony_ci 7513498266Sopenharmony_ci<data1300> 7613498266Sopenharmony_ciHTTP/1.1 401 Sorry wrong password (2) 7713498266Sopenharmony_ciServer: Microsoft-IIS/5.0 7813498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1 7913498266Sopenharmony_ciContent-Length: 29 8013498266Sopenharmony_ciWWW-Authenticate: Digest realm="testrealm", nonce="5" 8113498266Sopenharmony_ci 8213498266Sopenharmony_ciThis is a bad password page! 8313498266Sopenharmony_ci</data1300> 8413498266Sopenharmony_ci 8513498266Sopenharmony_ci<!-- Fourth request has Digest auth, wrong password --> 8613498266Sopenharmony_ci<data400> 8713498266Sopenharmony_ciHTTP/1.1 401 Need Digest auth (4) 8813498266Sopenharmony_ciServer: Microsoft-IIS/5.0 8913498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1 9013498266Sopenharmony_ciContent-Length: 27 9113498266Sopenharmony_ciWWW-Authenticate: Digest realm="testrealm", nonce="6" 9213498266Sopenharmony_ci 9313498266Sopenharmony_ciThis is not the real page! 9413498266Sopenharmony_ci</data400> 9513498266Sopenharmony_ci 9613498266Sopenharmony_ci<data1400> 9713498266Sopenharmony_ciHTTP/1.1 401 Sorry wrong password (3) 9813498266Sopenharmony_ciServer: Microsoft-IIS/5.0 9913498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1 10013498266Sopenharmony_ciContent-Length: 29 10113498266Sopenharmony_ciWWW-Authenticate: Digest realm="testrealm", nonce="7" 10213498266Sopenharmony_ci 10313498266Sopenharmony_ciThis is a bad password page! 10413498266Sopenharmony_ci</data1400> 10513498266Sopenharmony_ci 10613498266Sopenharmony_ci<!-- Fifth request has Digest auth, right password --> 10713498266Sopenharmony_ci<data1500> 10813498266Sopenharmony_ciHTTP/1.1 200 Things are fine in server land (2) 10913498266Sopenharmony_ciServer: Microsoft-IIS/5.0 11013498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1 11113498266Sopenharmony_ciContent-Length: 32 11213498266Sopenharmony_ci 11313498266Sopenharmony_ciFinally, this is the real page! 11413498266Sopenharmony_ci</data1500> 11513498266Sopenharmony_ci 11613498266Sopenharmony_ci<datacheck> 11713498266Sopenharmony_ciHTTP/1.1 401 Need Digest auth 11813498266Sopenharmony_ciServer: Microsoft-IIS/5.0 11913498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1 12013498266Sopenharmony_ciContent-Length: 27 12113498266Sopenharmony_ciWWW-Authenticate: Digest realm="testrealm", nonce="1" 12213498266Sopenharmony_ci 12313498266Sopenharmony_ciHTTP/1.1 401 Sorry wrong password 12413498266Sopenharmony_ciServer: Microsoft-IIS/5.0 12513498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1 12613498266Sopenharmony_ciContent-Length: 29 12713498266Sopenharmony_ciWWW-Authenticate: Digest realm="testrealm", nonce="2" 12813498266Sopenharmony_ci 12913498266Sopenharmony_ciThis is a bad password page! 13013498266Sopenharmony_ciHTTP/1.1 200 Things are fine in server land 13113498266Sopenharmony_ciServer: Microsoft-IIS/5.0 13213498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1 13313498266Sopenharmony_ciContent-Length: 32 13413498266Sopenharmony_ci 13513498266Sopenharmony_ciFinally, this is the real page! 13613498266Sopenharmony_ciHTTP/1.1 401 Need Digest auth (3) 13713498266Sopenharmony_ciServer: Microsoft-IIS/5.0 13813498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1 13913498266Sopenharmony_ciContent-Length: 27 14013498266Sopenharmony_ciWWW-Authenticate: Digest realm="testrealm", nonce="4" 14113498266Sopenharmony_ci 14213498266Sopenharmony_ciHTTP/1.1 401 Sorry wrong password (2) 14313498266Sopenharmony_ciServer: Microsoft-IIS/5.0 14413498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1 14513498266Sopenharmony_ciContent-Length: 29 14613498266Sopenharmony_ciWWW-Authenticate: Digest realm="testrealm", nonce="5" 14713498266Sopenharmony_ci 14813498266Sopenharmony_ciThis is a bad password page! 14913498266Sopenharmony_ciHTTP/1.1 401 Sorry wrong password (3) 15013498266Sopenharmony_ciServer: Microsoft-IIS/5.0 15113498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1 15213498266Sopenharmony_ciContent-Length: 29 15313498266Sopenharmony_ciWWW-Authenticate: Digest realm="testrealm", nonce="7" 15413498266Sopenharmony_ci 15513498266Sopenharmony_ciHTTP/1.1 401 Sorry wrong password (3) 15613498266Sopenharmony_ciServer: Microsoft-IIS/5.0 15713498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1 15813498266Sopenharmony_ciContent-Length: 29 15913498266Sopenharmony_ciWWW-Authenticate: Digest realm="testrealm", nonce="7" 16013498266Sopenharmony_ci 16113498266Sopenharmony_ciThis is a bad password page! 16213498266Sopenharmony_ciHTTP/1.1 200 Things are fine in server land (2) 16313498266Sopenharmony_ciServer: Microsoft-IIS/5.0 16413498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1 16513498266Sopenharmony_ciContent-Length: 32 16613498266Sopenharmony_ci 16713498266Sopenharmony_ciFinally, this is the real page! 16813498266Sopenharmony_ci</datacheck> 16913498266Sopenharmony_ci 17013498266Sopenharmony_ci</reply> 17113498266Sopenharmony_ci 17213498266Sopenharmony_ci# Client-side 17313498266Sopenharmony_ci<client> 17413498266Sopenharmony_ci<server> 17513498266Sopenharmony_cihttp 17613498266Sopenharmony_ci</server> 17713498266Sopenharmony_ci<features> 17813498266Sopenharmony_ci!SSPI 17913498266Sopenharmony_cicrypto 18013498266Sopenharmony_ci</features> 18113498266Sopenharmony_ci<tool> 18213498266Sopenharmony_cilibauthretry 18313498266Sopenharmony_ci</tool> 18413498266Sopenharmony_ci 18513498266Sopenharmony_ci<name> 18613498266Sopenharmony_ciHTTP authorization retry (Digest) 18713498266Sopenharmony_ci</name> 18813498266Sopenharmony_ci <setenv> 18913498266Sopenharmony_ci# we force our own host name, in order to make the test machine independent 19013498266Sopenharmony_ciCURL_GETHOSTNAME=curlhost 19113498266Sopenharmony_ci# we try to use the LD_PRELOAD hack, if not a debug build 19213498266Sopenharmony_ciLD_PRELOAD=%PWD/libtest/.libs/libhostname.so 19313498266Sopenharmony_ci </setenv> 19413498266Sopenharmony_ci<command> 19513498266Sopenharmony_cihttp://%HOSTIP:%HTTPPORT/%TESTNUMBER digest digest 19613498266Sopenharmony_ci</command> 19713498266Sopenharmony_ci<precheck> 19813498266Sopenharmony_cichkhostname curlhost 19913498266Sopenharmony_ci</precheck> 20013498266Sopenharmony_ci</client> 20113498266Sopenharmony_ci 20213498266Sopenharmony_ci# Verify data after the test has been "shot" 20313498266Sopenharmony_ci<verify> 20413498266Sopenharmony_ci<protocol> 20513498266Sopenharmony_ciGET /%TESTNUMBER0100 HTTP/1.1 20613498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT 20713498266Sopenharmony_ciAccept: */* 20813498266Sopenharmony_ci 20913498266Sopenharmony_ciGET /%TESTNUMBER0100 HTTP/1.1 21013498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT 21113498266Sopenharmony_ciAuthorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/%TESTNUMBER0100", response="f7fd60eefaff5225971bf9b3d80d6ba6" 21213498266Sopenharmony_ciAccept: */* 21313498266Sopenharmony_ci 21413498266Sopenharmony_ciGET /%TESTNUMBER0200 HTTP/1.1 21513498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT 21613498266Sopenharmony_ciAuthorization: Digest username="testuser", realm="testrealm", nonce="2", uri="/%TESTNUMBER0200", response="785ca3ef511999f7e9c178195f5b388c" 21713498266Sopenharmony_ciAccept: */* 21813498266Sopenharmony_ci 21913498266Sopenharmony_ciGET /%TESTNUMBER0300 HTTP/1.1 22013498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT 22113498266Sopenharmony_ciAccept: */* 22213498266Sopenharmony_ci 22313498266Sopenharmony_ciGET /%TESTNUMBER0300 HTTP/1.1 22413498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT 22513498266Sopenharmony_ciAuthorization: Digest username="testuser", realm="testrealm", nonce="4", uri="/%TESTNUMBER0300", response="4c735d2360fd6848e7cb32a11ae3612b" 22613498266Sopenharmony_ciAccept: */* 22713498266Sopenharmony_ci 22813498266Sopenharmony_ciGET /%TESTNUMBER0400 HTTP/1.1 22913498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT 23013498266Sopenharmony_ciAuthorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/%TESTNUMBER0400", response="f5906785511fb60a2af8b1cd53008ead" 23113498266Sopenharmony_ciAccept: */* 23213498266Sopenharmony_ci 23313498266Sopenharmony_ciGET /%TESTNUMBER0400 HTTP/1.1 23413498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT 23513498266Sopenharmony_ciAuthorization: Digest username="testuser", realm="testrealm", nonce="5", uri="/%TESTNUMBER0400", response="f5906785511fb60a2af8b1cd53008ead" 23613498266Sopenharmony_ciAccept: */* 23713498266Sopenharmony_ci 23813498266Sopenharmony_ciGET /%TESTNUMBER0500 HTTP/1.1 23913498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT 24013498266Sopenharmony_ciAuthorization: Digest username="testuser", realm="testrealm", nonce="7", uri="/%TESTNUMBER0500", response="8ef4d935fd964a46c3965c0863b52cf1" 24113498266Sopenharmony_ciAccept: */* 24213498266Sopenharmony_ci 24313498266Sopenharmony_ci</protocol> 24413498266Sopenharmony_ci</verify> 24513498266Sopenharmony_ci</testcase> 246