Skip to content

http: fix bug in ntlm_allow=1 handling#6136

Merged
dscho merged 1 commit intogit-for-windows:mainfrom
mjcheetham:ntlm-allow-fix
Mar 23, 2026
Merged

http: fix bug in ntlm_allow=1 handling#6136
dscho merged 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
Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing this bug!

@dscho dscho merged commit 1751905 into git-for-windows:main Mar 23, 2026
170 of 174 checks passed
@mjcheetham mjcheetham deleted the ntlm-allow-fix branch March 23, 2026 13:17
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.

3 participants