-
Notifications
You must be signed in to change notification settings - Fork 852
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
autoProxy=true not creating https / no_proxy variables (as reported in #11551 ) #12469
Comments
Logs are required for review from WSL teamIf this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. How to collect WSL logsDownload and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The script will output the path of the log file once done. If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here Once completed please upload the output files to this Github issue. Click here for more info on logging View similar issuesPlease view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it! Open similar issues:
Closed similar issues:
|
/emailed-logs |
Diagnostic information
|
previously reported here: #11551 |
Hi there. WinHTTP is not reporting that there's an HTTPS proxy: 63 30348.15140 2025-01-15T16:36:38.257 [Microsoft.Windows.Lxss.Manager] s_GetProxySettingsExCallback-Results: pcwszProxy=http://outproxy2.pnet.ch:3128 pcwszSecureProxy= pcwszAutoconfigUrl=http://wpad.pnet.ch/wpad.dat cProxyBypasses=0 How was the HTTPS proxy set? good point about WSL_PAC_URL also not being set in lower-case. I forget the Linux rules and appcompat on this variable - we'll take a look. |
Following up on WSL_PAC_URL: that's a new environment variable we created with WSL2 - so we did not have compat reasons to create it both lower-case and upper-case. That will always be created as this one string. |
Hello, Thanks. |
@z3non , can you please capture a full network trace where we can see what WinHTTP is seeing in the pac file? https://github.com/microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1 Thanks! |
/emailed-logs |
Diagnostic information
|
Hi @keith-horton , I sent the networking logs via email. Regarding your question about how the HTTPS proxy was set I am still waiting for feedback from our system management team. I checked our pac file in the meantime. There we use the "PROXY" keyword, so no distinction between HTTPS/HTTP in the findProxyForUrl() function:
|
Thanks! I followed up with our HTTP experts who implement WinHTTP proxy support. They stated that in the PAC file the https proxy should be given with “HTTPS” keyword. Something like proxy[0] = "HTTPS outproxy1.example.com:443". Can you verify that works if the PAC file is updated to specify HTTPS? |
The wikipedia description of the PAC format reads as follows:
I couldn't find anything more authoritative than this definition on wikipedia. Assuming this reflects the industry agreed semantics of this format the entries using the "PROXY" keyword should be sufficient to indicate also the HTTPS proxy. Do your http experts have a different opinion on this or a more up2date definition of the PAC format? |
@z3non , thanks for more context. I'll share this with them and get back to you. |
@z3non , I followed up. We have some work on our side to better document our support (we need to update https://learn.microsoft.com/en-us/windows/win32/winhttp/winhttp-autoproxy-support ). The feedback was that the single PROXY keyword doesn't designate what protocol is intended (PAC files originally supported only HTTP protocol - so PROXY was inferred to that - as secure proxies are a more recent addition). I would recommend specifying the protocol in your PAC file. Thanks! |
similar #11998 |
I created a script that you can run once logged in I could not get the environment variables to load when running this from root so you have to run it sudo -E ./autoproy.sh
You must have a wpad (autoproxy server on network ) running and your Windows 11 getting your settings correctly also your WSL must show the proxy info when you run after that you can simply adapt the /etc/environment have a copy of the old one with no proxy for when your on a network without a proxy and $HTTP_PROXY shows nothing and another for your proxy you use Example: proxy on
and one without proxy off
I also attempted to just add the $HTTP_PROXY variable into /etc/environment again it will not use it with export it wants a string. Just an idea and more info on the actutal problem, /etc/environment is not adding any autoproxy info everything else does in WSL. My basic script just replaces the /etc/enviroment with a proxy copy as needed. again it must be run with the -E to keep the user enironment's auto proxy settings for the if else conditional checks so to run the script I created the file edited it with chmod and crown and run it like this when I need it.
crude but a temp fix. I wanted to use an @reboot crontab with it again that requires the user environment and sudo to do the copy over. Any other ideas for a longterm automatic fix? |
What I would like to do is just use the output from echo $HTTP_PROXY that is auto populated with WSL and just place it into /etc/environment like this better /etc/environment
but it wont recognize the system variable that is already generated with auto proxy enabled and populated by way of wpad on the host Windows 11 machine for some reason. |
Windows Version
Microsoft Windows [Version 10.0.22631.4602]
WSL Version
2.3.26.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.167.4-1
Distro Version
No response
Other Software
Repro Steps
run wsl
check environment variables
Expected Behavior
WSL to configure http and https proxy variables as stated here: WSL Troubleshoot
Actual Behavior
Only http_proxy, HTTP_PROXY and WSL_PAC_URL are being created on wsl.
Diagnostic Logs
will be sent by email
The text was updated successfully, but these errors were encountered: