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

Unable to connect to HTTP urls in WSL2; but HTTPS works #6166

Closed
shadab16 opened this issue Oct 29, 2020 · 1 comment
Closed

Unable to connect to HTTP urls in WSL2; but HTTPS works #6166

shadab16 opened this issue Oct 29, 2020 · 1 comment
Labels

Comments

@shadab16
Copy link

Environment

Microsoft Windows [Version 10.0.18363.1049]
Release:        20.04
Linux version 4.19.128-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Tue Jun 23 12:58:10 UTC 2020

Steps to reproduce

Accessing any HTTP url from WSL2 doesn't work and gets timed out.

$ curl -I -4 http://www.microsoft.com

Strace output:

https://gist.github.com/shadab16/7d740d5c1fb970bd7880669eef953a1e

$ strace -ff -o strace-output.txt curl -I -4 http://www.microsoft.com
...
socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) = 5
setsockopt(5, SOL_TCP, TCP_NODELAY, [1], 4) = 0
setsockopt(5, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
setsockopt(5, SOL_TCP, TCP_KEEPIDLE, [60], 4) = 0
setsockopt(5, SOL_TCP, TCP_KEEPINTVL, [60], 4) = 0
fcntl(5, F_GETFL)                       = 0x2 (flags O_RDWR)
fcntl(5, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
connect(5, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("23.201.221.228")}, 16) = -1 EINPROGRESS (Operation now in progress)
poll([{fd=5, events=POLLOUT|POLLWRNORM}], 1, 0) = 0 (Timeout)
rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f72499fd3c0}, NULL, 8) = 0
poll([{fd=5, events=POLLOUT}, {fd=3, events=POLLIN}], 2, 10) = 0 (Timeout)
...

DNS lookup:

;; QUESTION SECTION:
;www.microsoft.com.             IN      A

;; ANSWER SECTION:
www.microsoft.com.      0       IN      CNAME   www.microsoft.com-c-3.edgekey.net.
www.microsoft.com-c-3.edgekey.net. 0 IN CNAME   www.microsoft.com-c-3.edgekey.net.globalredir.akadns.net.
www.microsoft.com-c-3.edgekey.net.globalredir.akadns.net. 0 IN CNAME e13678.dspb.akamaiedge.net.
e13678.dspb.akamaiedge.net. 0   IN      A       23.201.221.228

;; Query time: 10 msec
;; SERVER: 192.168.187.113#53(192.168.187.113)
;; WHEN: Thu Oct 29 06:07:57 IST 2020
;; MSG SIZE  rcvd: 340

WSL logs:
https://aka.ms/AAa3t7r

Expected behavior

The expected output is on the left. Both http and https calls are successful when running cURL in Windows (Command Prompt), non-elevated.

image

Actual behavior

The problematic output is on the right. Only https calls succeed; and the http calls fail. This is observed across multiple end-points (microsoft.com, yahoo.com, google.com, netflix.com, ubuntu.com).

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
Projects
None yet
Development

No branches or pull requests

2 participants