-
Notifications
You must be signed in to change notification settings - Fork 1.9k
net/tshttpproxy: fix WDAP/PAC proxy detection on Win10 1607 and earlier #16130
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
Pull Request Revisions
✅ AI review completed for r5 HelpReact with emojis to give feedback on AI-generated reviews:
We'd love to hear from you—reach out anytime at team@review.ai. |
0654d72
to
393828b
Compare
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.
Can we just use wingoes
for the version detection?
Thanks for pointing out that we have something similar in But its implementation is based on |
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.
Nice find.
LGTM for the tshttpproxy bit at least.
You can Aaron can work out where the version checking goes.
I like the sync.OnceValue to only do the system call once.
// which prevents proxy detection and can lead to failures reaching the control server | ||
// on environments where a proxy is required. | ||
// | ||
// https://web.archive.org/web/20250529044903/https://learn.microsoft.com/en-us/windows/win32/api/winhttp/ns-winhttp-winhttp_autoproxy_options |
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.
hah, using archive.org because Microsoft can't keep breaking their URLs every few years. lolsob.
cba49ea
to
edc6eb2
Compare
Using WINHTTP_AUTOPROXY_ALLOW_AUTOCONFIG on Windows versions older than Windows 10 1703 (build 15063) is not supported and causes WinHttpGetProxyForUrl to fail with ERROR_INVALID_PARAMETER. This results in failures reaching the control on environments where a proxy is required. We use wingoes version detection to conditionally set the WINHTTP_AUTOPROXY_ALLOW_AUTOCONFIG flag on Windows builds greater than 15063. While there, we also update proxy detection to use WINHTTP_AUTO_DETECT_TYPE_DNS_A, as DNS-based proxy discovery might be required with Active Directory and in certain other environments. Updates tailscale/corp#29168 Fixes #879 Signed-off-by: Nick Khyl <nickk@tailscale.com>
edc6eb2
to
9dccb48
Compare
Updated this PR to use |
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.
Thanks!
Using
WINHTTP_AUTOPROXY_ALLOW_AUTOCONFIG
on Windows versions older than Windows 10 1703 (build 15063) is not supported and causesWinHttpGetProxyForUrl
to fail withERROR_INVALID_PARAMETER
. This results in failures reaching the control on environments where a proxy is required.We use
wingoes
version detection to conditionally set theWINHTTP_AUTOPROXY_ALLOW_AUTOCONFIG
flagon Windows builds greater than 15063.
While there, we also update proxy detection to use
WINHTTP_AUTO_DETECT_TYPE_DNS_A
, as DNS-based proxy discovery might be required with Active Directory and in certain other environments.Updates tailscale/corp#29168
Fixes #879