mirror of
https://github.com/curl/curl.git
synced 2026-07-26 01:07:16 +03:00
http: do not require a user name when using CURLAUTH_NEGOTIATE
In order to get Negotiate (SPNEGO) authentication to work in HTTP you used to be required to provide a (fake) user name (this concerned both curl and the lib) because the code wrongly only considered authentication if there was a user name provided, as in: curl -u : --negotiate https://example.com/ This commit leverages the `struct auth` want member to figure out if the user enabled CURLAUTH_NEGOTIATE, effectively removing the requirement of setting a user name both in curl and the lib. Signed-off-by: Marin Hannache <git@mareo.fr> Reported-by: Enrico Scholz Fixes https://sourceforge.net/p/curl/bugs/440/ Fixes #1161 Closes #9047
This commit is contained in:
parent
c90c78333b
commit
67e9e3cb1e
6 changed files with 10 additions and 18 deletions
|
|
@ -866,7 +866,12 @@ Curl_http_output_auth(struct Curl_easy *data,
|
|||
#ifndef CURL_DISABLE_PROXY
|
||||
(conn->bits.httpproxy && conn->bits.proxy_user_passwd) ||
|
||||
#endif
|
||||
data->state.aptr.user || data->set.str[STRING_BEARER])
|
||||
data->state.aptr.user ||
|
||||
#ifdef USE_SPNEGO
|
||||
authhost->want & CURLAUTH_NEGOTIATE ||
|
||||
authproxy->want & CURLAUTH_NEGOTIATE ||
|
||||
#endif
|
||||
data->set.str[STRING_BEARER])
|
||||
/* continue please */;
|
||||
else {
|
||||
authhost->done = TRUE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue