mirror of
https://github.com/curl/curl.git
synced 2026-08-24 16:13:43 +03:00
tests: add SPNEGO NTLM blocking tests
test2092 verifies that when only NTLM credentials are available and CURL_DISABLE_NEGOTIATE_NTLM is active, SPNEGO auth is silently skipped and the request is sent without an Authorization header. test2093 verifies that Kerberos credentials still succeed when built with CURL_DISABLE_NEGOTIATE_NTLM. Both tests require the negotiate-ntlm-disabled feature, which is reported by curl --version as "SPNEGO-no-NTLM" when the compile-time option is active. Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
This commit is contained in:
parent
8f21383178
commit
3ea51e7a1f
3 changed files with 127 additions and 1 deletions
68
tests/data/test2093
Normal file
68
tests/data/test2093
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
<?xml version="1.0" encoding="US-ASCII"?>
|
||||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
HTTP
|
||||
HTTP GET
|
||||
HTTP Negotiate auth (stub krb5)
|
||||
SPNEGO NTLM disallowed
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
# Server-side
|
||||
<reply>
|
||||
<data1>
|
||||
HTTP/1.1 200 Things are fine in server land
|
||||
Server: Microsoft-IIS/7.0
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
WWW-Authenticate: Negotiate RA==
|
||||
Content-Length: 15
|
||||
|
||||
Nice auth sir!
|
||||
</data1>
|
||||
<datacheck>
|
||||
HTTP/1.1 200 Things are fine in server land
|
||||
Server: Microsoft-IIS/7.0
|
||||
Content-Type: text/html; charset=iso-8859-1
|
||||
WWW-Authenticate: Negotiate RA==
|
||||
Content-Length: 15
|
||||
|
||||
Nice auth sir!
|
||||
</datacheck>
|
||||
</reply>
|
||||
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
http
|
||||
</server>
|
||||
<name>
|
||||
SPNEGO with Kerberos still works when built with CURL_DISABLE_NEGOTIATE_NTLM
|
||||
</name>
|
||||
<features>
|
||||
GSS-API
|
||||
Debug
|
||||
</features>
|
||||
<setenv>
|
||||
CURL_STUB_GSS_CREDS="KRB5_Alice"
|
||||
</setenv>
|
||||
<command>
|
||||
--negotiate http://%HOSTIP:%HTTPPORT/%TESTNUMBER
|
||||
</command>
|
||||
</client>
|
||||
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<errorcode>
|
||||
0
|
||||
</errorcode>
|
||||
<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: */*
|
||||
|
||||
</protocol>
|
||||
</verify>
|
||||
</testcase>
|
||||
Loading…
Add table
Add a link
Reference in a new issue