-
Notifications
You must be signed in to change notification settings - Fork 40
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
Authenticating against target server hangs the thread when sending a POST request (that has a non empty body) #77
Comments
I didn't know there was a feature to authenticate against non-proxy servers. It would seem best to remove that code indeed. If there is any documentation hinting at authentication against non-proxy servers, it should be removed along with it. |
Indeed the original documentation claims that it supports transparent connection to ntlm authenticated servers:
So authentication against target servers is an advertised feature, and the original author tested a lot.
I guess the issue is with POST requests, where you need to send the body request twice (the second time after you completed the authentication sequence). For sure it works with GET requests (without a body). So for now I change the title of this issue. Let's see if there is a way to keep this feature and make it more robust (maybe disabling the authentication for POST requests). |
It depends on the complexity of the code. HTTP without SSL is disappearing, so at some point this code would not really be used while it does contribute to the complexity of the program. |
Yes, a quick fix is to add a test that the request body is empty:
In this case the feature is still working, and does not break with POST requests. I agree that this requirement is obsolete, probably nowadays there are no more clients not able to deal with ntlm authentication, but since the code is there and a quick fix prevents it from breaking, I think for now we can keep it. |
Recently I stumbled upon an unusual use case, where there is a remote server that accepts plain http connections (not https) and requires NTLM authentication. Cntlm tries and authenticate but hangs the thread (mainly because it should send the request body twice, but the second time it is not available any more).
By removing this code block...
cntlm/direct.c
Lines 333 to 380 in d6047b6
...it works because the authentication is delegated to the client.
This use case is very rare because usually connections are in https and cntlm simply tunnels them.
In my opinion this behaviour is out of scope because cntlm should deal with authentications against proxies and not against target servers.
I propose to remove this code block completely. (I guess nobody has ever tested this piece of code).
The text was updated successfully, but these errors were encountered: