Skip to content
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

WSL can't connect to microsoft.com and some of its subdomains #7789

Closed
1 of 2 tasks
Karl255 opened this issue Dec 1, 2021 · 3 comments
Closed
1 of 2 tasks

WSL can't connect to microsoft.com and some of its subdomains #7789

Karl255 opened this issue Dec 1, 2021 · 3 comments

Comments

@Karl255
Copy link

Karl255 commented Dec 1, 2021

Version

Microsoft Windows [Version 10.0.19043.1348]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.4.72

Distro Version

Ubuntu 20.04, Ubuntu 18.04

Other Software

microsoft.com
packages.microsoft.com
pypi.org

I wasn't able to find any other domains that exhibited this issue.

Repro Steps

Run curl -v https://microsoft.com in WSL.

Expected Behavior

curl manages to establish a secure connection and prints the returned data.

Actual Behavior

curl gets stuck during the TLS handshake. I've left it for minutes and it just stayed at the same step, without crashing and showing an error.

$ curl -v https://microsoft.com
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 40.113.200.201:443...
* TCP_NODELAY set
* Connected to microsoft.com (40.113.200.201) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
  0     0    0     0    0     0      0      0 --:--:--  0:00:03 --:--:--     0^C⏎

Diagnostic Logs

There are no issues with any of this outside WSL. I tried everything that got to my mind: using the same software for making network requests (curl, Insomnia...) on both Windows and WSL. It consistently works without issues on Windows and 99% of the time gets stuck at the TLS handshake in WSL. The very rare successful TLS handshakes I've experienced while trying to compile curl from source with different TLS backends, though there was no pattern whatsoever in the successful connections. Every time I got a successful connection I tried to curl that same server again by specifying the IP address form curl's verbose output, but it never worked again which means the issue probably isn't at Microsoft's end. Other things I've tried: using a VPN, analyzing the network traffic with Wireshark, turning off the firewall and built-in AV, uninstalling networking-related software and whatnot.

I've been having this issue for at least 2 years now and during this time I've reinstalled Windows, reinstalled my WSL instances at least twice... but the issue still persisted during that whole time.

It would seem that the issue might be related to either #3761 or #5248, but no, they're both different, one being an issue with an AV and the other with a VPN.

Captured network traffic with Wireshark: wsl-curl-wireshark-capture.zip

@Reintjuu
Copy link

I had exactly the same issue, and this fixed the issue for me: #4698 (comment).

@gc250274
Copy link

Open windows firewall and add wsl application and check all the boxes and restart the computer.
This solved my connection issue.

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

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

No branches or pull requests

3 participants