WSL: Cannot connect to Internet via https
UPDATE: initially the issue was named “Cannot install dotnet sdk from https://packages.microsoft.com”. It was the case I encountered with the problem. But actually I’m having problems with connecting to any https site.
Windows Version 10.0.16299.64 WSL Ubuntu (uname -a): Linux 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux
I’m trying to install dotnet sdk as described here - https://www.microsoft.com/net/learn/get-started/linuxubuntu
My machine is behind a corporate proxy, so I have exported http_proxy and https_proxy.
I can curl/wget any pages, so example: curl https://packages.microsoft.com/ returns me some html.
I can install a pacakge via apt-get:
sudo apt-get upgrade curl
So in general the system is healthy and can connect to internet.
But it seems that apt-get cannot install a package via https.
After I added a new source for dotnet “https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main” and run sudo apt-get update it stuck on that source (https://packages.microsoft.com):
Err:9 https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial InRelease Failed to connect to packages.microsoft.com port 443: Connection refused
I also tried to force IPv4 connection (sudo apt-get -o Acquire::ForceIPv4=true update) but it didn’t change anything.
I have no any antivirus installed.
I run sudo strace -o aptget.txt -ff apt-get -o Acquire::ForceIPv4=true update but it creates so many files:
Not sure which one to share:

About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 18 (1 by maintainers)
I’m also using Kaspersky and when closing the Antivirus It’s immediately works, no restart needed (pausing the protection however didn’t fix the issue…only full exit). When I’ll have the time I will try to find out how to keep kasp working and also be able to use https on the WSL, maybe an exception rule for application or port will do the bypass.
I think that it is fair to say that Kaspersky has something to do with that issue…
For easy counting of how many Kaspersky users have this problem, please respond with 👀 if you have this issue and you are also using Kaspersky.