<?xml version="1.0" encoding="US-ASCII"?>
<testcase>
# The first transfer sends a Negotiate token that the server accepts (the
# reply carries its final GSS token) but the page is denied with a 401. The
# server may regard the connection as authenticated nonetheless, so a second
# transfer without credentials must not reuse it.
<info>
<keywords>
HTTP
HTTP GET
HTTP Negotiate auth (stub krb5)
connection reuse
--next
</keywords>
</info>
<reply>
<data1 nocheck="yes" crlf="headers">
HTTP/1.1 401 Authenticated but not authorized
Server: Microsoft-IIS/7.0
WWW-Authenticate: Negotiate RA==
Content-Length: 0

</data1>
<data2 nocheck="yes" crlf="headers">
HTTP/1.1 200 OK
Content-Length: 0

</data2>
<servercmd>
connection-monitor
</servercmd>
</reply>

<client>
<server>
http
</server>
<name>
HTTP Negotiate connection not reused without credentials after a 401
</name>
<features>
GSS-API
Debug
</features>
<setenv>
CURL_STUB_GSS_CREDS="KRB5_Alice"
</setenv>
<command option="no-include">
--negotiate http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w "connects=%{num_connects}/" --next http://%HOSTIP:%HTTPPORT/%TESTNUMBER0002 -w "connects=%{num_connects}/"
</command>
</client>

<verify>
<protocol crlf="headers">
GET /%TESTNUMBER HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Authorization: Negotiate %b64["KRB5_Alice":HTTP@127.0.0.1:1:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA]b64%
User-Agent: curl/%VERSION
Accept: */*

[DISCONNECT]
GET /%TESTNUMBER0002 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
User-Agent: curl/%VERSION
Accept: */*

[DISCONNECT]
</protocol>
<stdout nonewline="yes">
connects=1/connects=1/
</stdout>
</verify>
</testcase>
