-
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
Resolve problems connections coming in via SOCKS #92
Conversation
Hello @jschwartzenberg this is a good catch. The code could be even simplified a bit, and I also suggest to use "hostname" instead of "thost_noport" (I know that it can contain an ip address rather than a real hostname) just to be consistent with other parts of the codebase. Also, a |
fe8dd28
to
8a17448
Compare
Hi @fralken thank you so much for the feedback!! I was already testing with the frees that Sonar pointed me to, so I just pushed those as my tests were successful. I will work on the points you made and do another push! |
df3a393
to
91a5076
Compare
That's great! I just added a comment on the |
91a5076
to
78fda05
Compare
|
Now I guess it's ok. All quality checks pass (only DeepSource fails but for issues not related to this PR). Thanks for testing the Socks connection. |
I was running into issues with connections that were reaching CNTLM via SOCKS. First of all it would try to use a proxy server whereas according to the PAC file there would be a direct connection. It seems that specifying
/
as the URL was not what the rest of the code was expecting. I saw that other code was passing the hostname or IP address instead plus the port number and the hostname or IP address without a port number. Once I changed that,, connections were made correctly directly.I also saw problems due to the incomplete
data1
structure after the code was passing throughprepare_http_connect
, so I added the hostname and port number to it. This can result in a segfault later on as the data is expected to be there.With these fixes in place CNTLM is not crashing anymore and handling SOCKS connections without problems. I guess the code is not perfect though, so I'd be happy to get any feedback that would help to improve things :)