Skip to content

Commit 5013802

Browse files
committed
Merge branch 'cs/http-use-basic-after-failed-negotiate'
When accessing a server with a URL like https://user:pass@site/, we did not to fall back to the basic authentication with the credential material embedded in the URL after the "Negotiate" authentication failed. Now we do. * cs/http-use-basic-after-failed-negotiate: remote-curl: fall back to basic auth if Negotiate fails
2 parents b2309ad + 1b0d954 commit 5013802

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

http.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,17 +1650,18 @@ static int handle_curl_result(struct slot_results *results)
16501650
} else if (missing_target(results))
16511651
return HTTP_MISSING_TARGET;
16521652
else if (results->http_code == 401) {
1653+
#ifdef LIBCURL_CAN_HANDLE_AUTH_ANY
1654+
http_auth_methods &= ~CURLAUTH_GSSNEGOTIATE;
1655+
if (results->auth_avail) {
1656+
http_auth_methods &= results->auth_avail;
1657+
http_auth_methods_restricted = 1;
1658+
return HTTP_REAUTH;
1659+
}
1660+
#endif
16531661
if (http_auth.username && http_auth.password) {
16541662
credential_reject(&http_auth);
16551663
return HTTP_NOAUTH;
16561664
} else {
1657-
#ifdef LIBCURL_CAN_HANDLE_AUTH_ANY
1658-
http_auth_methods &= ~CURLAUTH_GSSNEGOTIATE;
1659-
if (results->auth_avail) {
1660-
http_auth_methods &= results->auth_avail;
1661-
http_auth_methods_restricted = 1;
1662-
}
1663-
#endif
16641665
return HTTP_REAUTH;
16651666
}
16661667
} else {

0 commit comments

Comments
 (0)