Skip to content

http: fix bug in ntlm_allow=1 handling#6136

Open
mjcheetham wants to merge 1 commit intogit-for-windows:mainfrom
mjcheetham:ntlm-allow-fix
Open

http: fix bug in ntlm_allow=1 handling#6136
mjcheetham wants to merge 1 commit intogit-for-windows:mainfrom
mjcheetham:ntlm-allow-fix

Conversation

@mjcheetham
Copy link
Member

In 816db62 (credential: advertise NTLM suppression and allow helpers to re-enable, 2026-02-09), Git learned to advertise that NTLM authentication was suppressed to credential helpers. It also introduced a way to allow credential helpers to opt-back-in to NTLM authentication via the ntlm_allow=1 credential protocol flag.

There is a bug in the logic of 816db62 that means we are responding to the ntlm_allow=1 signal too late in the auth retry codepath; we've already made the second-attempt request!

Move adding of NTLM as a valid auth method to http_request_reauth right after the credential helper is consulted following the first request, but (now) before we made the second request.

In 816db62 (credential: advertise NTLM suppression and allow
helpers to re-enable, 2026-02-09), Git learned to advertise that NTLM
authentication was suppressed to credential helpers. It also introduced
a way to allow credential helpers to opt-back-in to NTLM authentication
via the `ntlm_allow=1` credential protocol flag.

There is a bug in the logic of 816db62 that means we are responding
to the `ntlm_allow=1` signal too late in the auth retry codepath; we've
already made the second-attempt request!

Move adding of NTLM as a valid auth method to `http_request_reauth`
right after the credential helper is consulted following the first
request, but (now) before we made the second request.

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
@mjcheetham mjcheetham requested a review from dscho March 20, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants