Fix https proxy not set when pac is used#40950
Open
chemwolf6922 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a WSL autoProxy/PAC scenario where WinHTTP proxy settings derived from a PAC script populate only the generic proxy field, causing WSL to set http_proxy but leave https_proxy empty. The change makes WSL populate https_proxy/HTTPS_PROXY from the PAC-derived proxy value when no secure proxy is provided, and adds regression coverage for both NAT and mirrored networking modes.
Changes:
- Update environment injection to set
https_proxy/HTTPS_PROXYto the PAC-derived proxy whenSecureProxyis empty. - Extend network tests to cover PAC-based proxy configuration in both NAT and mirrored networking.
- Ensure test cleanup clears
AutoconfigUrlwhen resetting WinHTTP proxy settings.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/windows/NetworkTests.cpp | Adds NAT + mirrored tests for PAC-based WinHTTP proxy propagation and updates proxy-reset helper to clear AutoconfigUrl. |
| src/windows/service/exe/LxssUserSession.cpp | Falls back to setting https_proxy/HTTPS_PROXY from Proxy when PAC is configured and SecureProxy is empty. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
PAC is not directly usable in WSL or in most headless Linux environments.
The WinHttpGetProxySettingsEx call only populates the pcwszProxy segment when PAC is enabled. And WSL only sets http_proxy but leaves https_proxy empty.
This PR sets both http_proxy and https_proxy to the default PAC query result as best effort.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
New unit tests:
NetworkTests::NetworkTests::NatHttpProxyPac
NetworkTests::MirroredTests::HttpProxyPac