versat / cntlm

Cntlm is an NTLM / NTLM Session Response / NTLMv2 authenticating HTTP proxy intended to help you break free from the chains of Microsoft proprietary world. More info on http://cntlm.sourceforge.net/ website. This version also supports: SSPI (on Windows, NTLM authentication only), Kerberos authentication, IPv6, proxy PAC files.
GNU General Public License v2.0
127 stars 40 forks source link

Refactor parent proxies and pac logic #73

Closed fralken closed 2 years ago

fralken commented 2 years ago

Pac file support is working but has some issues:

This PR moves the pac logic inside the proxy_connect() function, so that it is available for http proxy, socks5 and tunnel connections. Also, the lists of proxies created when parsing the string, returned by pacparser_find_proxy(), are cached so that each proxy is resolved only once.

All this proxy logic is moved into two new files, proxy.c and proxy.h, to better separate logic.

In addition, configuration of pac has been simplified, so instead of having

Pac yes
PacFile /path/to/proxy.pac

It is enough to write

Pac /path/to/proxy.pac

Finally, documentation has been updated (some features were still missing)

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

jschwartzenberg commented 2 years ago

Great work! I hope to test this intensively next week. I can't really judge the code. Possibly @versat will already find it ready to merge :)

fralken commented 2 years ago

@jschwartzenberg have you performed any test on this?

jschwartzenberg commented 2 years ago

Yeah, very limited though, but so far works fine!

fralken commented 2 years ago

Yeah, very limited though, but so far works fine!

I'll merge this PR as soon as you approve it.

jschwartzenberg commented 2 years ago

I just tested socks support as well. Works great!! I see versat already approved, so this is fully ready to merge. Quite a major feature to have full PAC support for socks as well! Thanks a lot!!