-
Notifications
You must be signed in to change notification settings - Fork 2.6k
gssapi: delete half-built security context so auth can continue #5236
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
gssapi: delete half-built security context so auth can continue #5236
Conversation
|
Thanks for the PR. I have two concerns:
|
|
Those are very valid points, and unfortunately I'm not very familiar with gssapi :( Curl seems to have a case where they also restart authentication, though some of the finer details elude me:
|
|
I set up a server that speaks SPNEGO to walk through this and I'm seeing some other problems in my configuration that I'm still trying to understand. |
|
Let me know if there's anything I can do to help move this forward. And thanks for the help so far! I gave #5238 a quick test on my mac and it worked great. |
|
We are hitting the same issue as @jonathanturcotte seems to have fixed with this PR. Are there any plans to move forward on this issue @ethomson? |
|
@ethomson: sorry to bump this again, just wondering if there was any updates or you needed anything from me to help move this forward |
Sorry for the delay @jonathanturcotte, it seems like I definitely broke gssapi more soundly when I refactored the networking. Even your PR is not enough to fix my system :( I'm digging in but it'll be a little bit longer before I understand what we've done wrong. Hopefully I'll know more over the weekend. |
|
Aha. I think I'm starting to understand: are you using an Apache (or maybe nginx?) web server? What (I think) I'm seeing (talking to an Apache server) is that it's tearing down the authenticated connection, which is absolutely insane, but we've seen reports of before (though with NTLM authentication). This is really not how the NTLM and SPNEGO authentication mechanisms were designed, doesn't really follow the spec and is insanely poorly performing. But something that we definitely need to support independent of all those things. |
|
We're currently using Bitbucket (which uses Tomcat), and this sounds like what I've seen debugging this on my end. We have also tried to do SPNEGO with an Apache setup, and we were seeing similar unexplained failures at times. I think that behaviour that you're describing is probably the root cause of both. |
|
Great. I've pulled in your change but I'll have some more for you to test in your environment 🔜. |
|
Awesome, thanks for your help with this! |
|
Any news @ethomson? This is unfortunately still preventing us from using Git. |
|
I added (opt-in) expect/continue support in #5286 I'm not done working on this, but I'd encourage you to ship a private branch with the changes that you need to get unblocked in the meantime. |
|
I've given that branch a try and now I'm seeing "no Content-Type header in response". For some extra context on what Bitbucket is giving us, here is the output of a GIT_CURL_VERBOSE=1 git clone on our repository: |
|
I appreciate the extra context. This is very surprising - bitbucket is speaking "dumb" HTTP here. Is it possible that the git version on the client or server is very old? https://confluence.atlassian.com/bitbucketserverkb/git-commands-return-error-code-400-779171756.html |
|
Ah, figured it out. It was a misconfiguration of our kerberos plugin on the server side, causing a failure to authenticate. Weird how commandline git creates an empty repository anyways 😒 This branch is now working great with GSSAPI repositories though! Unfortunately however I get segfaults in libssl when cloning over https 😩 SSH and Negotiate over HTTP work fine. We had this code working with 28.2, but I have a feeling that maybe something has changed in this branch and we need to change how we're calling the api. Here is the backtrace, if you have any ideas on what to check first that would be really helpful! |
This is a function of git's ability to speak both "dumb" http and "smart" http protocols. Dumb HTTP is basically a web server pointed at a
Looks like I broke something, that's definitely not right. I'll take a look. |
|
Which commit are you using for testing, @jonathanturcotte? Were you using the expect/continue changes or the most recent commit without enabling expect/continue? From the stack trace, it looks like I've done some more refactoring here than what you're running. |
|
Looks like you are right, I was testing 2a171b4. I've rebuilt to the latest commit on that branch, but am still seeing the segfault :/ The backtrace does look slightly different now: |
|
Did you have expect continue support enabled via the option or not? |
|
Sorry, I'm running this on your branch having compiled it with the -DUSE_GSSAPI=ON option. |
|
Closed via #5286 - thanks again for the patch! |
Fixes #5233.
As per the GNU Generic Security Service (GSS) API Reference Manual on page 15:
I have tested and confirmed that this fixes the issue we were having with our bitbucket + kerberos setup. Running the online tests against our bitbucket setup now succeeds:
Note that branched off of e24b885, as recent changes seem to have broken the
-DUSE_GSSAPI=ONbuild.