Skip to content

Fix https proxy not set when pac is used#40950

Open
chemwolf6922 wants to merge 2 commits into
masterfrom
user/chemwolf6922/fix-https_proxy-not-set-when-PAC-is-used
Open

Fix https proxy not set when pac is used#40950
chemwolf6922 wants to merge 2 commits into
masterfrom
user/chemwolf6922/fix-https_proxy-not-set-when-PAC-is-used

Conversation

@chemwolf6922

@chemwolf6922 chemwolf6922 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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

Copilot AI review requested due to automatic review settings June 30, 2026 06:06
@chemwolf6922 chemwolf6922 requested a review from a team as a code owner June 30, 2026 06:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_PROXY to the PAC-derived proxy when SecureProxy is empty.
  • Extend network tests to cover PAC-based proxy configuration in both NAT and mirrored networking.
  • Ensure test cleanup clears AutoconfigUrl when 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.

Comment thread test/windows/NetworkTests.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants