-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Use an HTTP scheme that supports the given credentials #5212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The dummy negotiation scheme is used for known authentication strategies that do not wish to act. For example, when a server requests the "Negotiate" scheme but libgit2 is not built with Negotiate support, and will use the "dummy" strategy which will simply not act. Instead of setting `out` to NULL and returning a successful code, return `GIT_PASSTHROUGH` to indicate that it did not act and catch that error code.
When a server responds with multiple scheme support - for example, Negotiate and NTLM are commonly used together - we need to ensure that we choose a scheme that supports the credentials.
Thanks @ianhattendorf for the patch, I made sure to list you as the author on the commit. |
Also, @ianhattendorf, can you double-check this? You mentioned in #5178 that you were seeing some test failures. If you're still seeing them with this branch, can you give me more details? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sensible to me, but I'm not too knowledgable when it comes to cred schemes. So waiting for @ianhattendorf's feedback
Thanks for looking into this. I'm getting sporadic failures on all 5 proxy tests. Sometimes tests 1 2 4 fail, other times 2 3 5, etc. Out of ~20 runs, all 5 passed successfully twice. @ethomson I'll see what I can do about getting you access to our test proxy server if that would help.
|
I'm going to go ahead and merge this since it's strictly an improvement. I'd be curious to follow up on your proxy problems, but at the moment, I can't recreate them. |
Don't try to select the "best" scheme that the server offers us without taking into account the credentials that the user has selected. Otherwise, the "best" scheme may not support the given credentials.
eg, many servers use both Negotiate and NTLM as a fallback. Negotiate only works with default credentials, while our NTLM implementation only works with username/password credentials. As a result, our caller has given us a particular kind of credentials and we must match those credentials to the schemes offered.
Instead of using the "best" overall scheme, use the "best" scheme (ordered first) that our credentials support.
Fixes #5178