WSL: While connected to VPN the curl command hangs up

OK: From our office and from home remotely, we can use the VPN connection, curl succeeds. OK: While visiting our customer’s office, without using the VPN connection, curl also succeeds. FAIL: While visiting our customer’s office, when using the VPN connection, curl hangs as follows:

$ curl ifconfig.co; curl -vvv https://testlink.limelightbox.com 
198.199.107.195 
* Rebuilt URL to: https://testlink.limelightbox.com/ 
* Trying 52.39.78.238... 
* TCP_NODELAY set 
* Connected to testlink.limelightbox.com (52.39.78.238) port 443 (#0) 
* ALPN, offering h2 
* ALPN, offering http/1.1 
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH 
* successfully set certificate verify locations: 
* CAfile: /etc/ssl/cert.pem 
CApath: none 
* TLSv1.2 (OUT), TLS handshake, Client hello (1):

Above simply hangs.

Can someone assist with advice

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 7
  • Comments: 36 (3 by maintainers)

Commits related to this issue

Most upvoted comments

May this could be a fix for you: Set MTU to the value of the VPN interface: sudo ifconfig eth0 mtu 1350

You could type in cmd.exe netsh interface ipv4 show subinterfaces and look at the leftmost column MTU.

It seems like I found out in packet dumps the ssl handshake is fragmented and gets dropped for some reason.

I have same issue as @giggio except that my curl works for public addresses such as google.com. Any internal resource inside company private network I get the same behavior as @giggio. Windows side works fine. Check Point Mobile VPN client opened in Windows that to my knowledge should route ALL traffic via company network.

I made the feedback as @craigloewen-msft instructed and it can be found here. Hope it helps.

I’m having a similar issue with our VPN.

Git and SSH both hang over the VPN from WSL but both work just fine from within Windows.

Windows version: Microsoft Windows [Version 10.0.18990.1]

The VPN client is Shrew Soft standard edition version 2.2.2.

By the way, I’ve been using this VPN client version with a VMware Linux VM for years just fine, NATing through windows.

May this could be a fix for you: Set MTU to the value of the VPN interface: sudo ifconfig eth0 mtu 1350

This works for me too.

my kernel

uname -a
Linux RioChndr-Lenovo-Legion 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

I make it permanent by add this line to /etc/wsl.conf

[boot]
command = sudo ifconfig eth0 mtu 1350

It’s a manual .msi and download from here. I’m currently on

erikm@erikm-pc2:~$ uname -a
Linux erikm-pc2 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 GNU/Linux

@giggio Here’s my setup:

1. Setup a HTTP or SOCKS5 proxy in Windows-land

I’m using cow, as I already have it installed (you can use whatever proxy software works). My cow config rc.txt is as below:

listen = http://0.0.0.0:7777

It does nothing other than proxying traffic from port 7777 to Windows network.

2. Setup curl/wget/git in WSL2 to use the Windows proxy above

  • for curl/wget, I’m using proxychains-ng, a software that forces any linux program use specified proxy. But if you only need curl or wget, just setting up http_proxy and https_proxy environment variable should be enough. e.g. export http_proxy=http://${your windows local IP}:7777
  • for git (that uses ssh protocol), add these config to ~/.ssh/config:
Host git.yourcompany.com
User git
ProxyCommand nc -X connect -x 192.168.2.171:7777  %h %p

replace git.yourcompany.com with your company’s Gitlab host, and replace 192.168.2.171 with your Windows machine’s local IP (see ipconfig.exe) and it’s done.

I’m having the exact same problem, I can’t work when connected to my company network. The network does not seem to work in some scenarios. DNS resolution works. Curl does not work, either with http or https.

This is what I get on http:

❯ curl --verbose http://www.google.com
*   Trying 172.217.29.132:80...
* TCP_NODELAY set
* Connected to www.google.com (172.217.29.132) port 80 (#0)
> GET / HTTP/1.1
> Host: www.google.com
> User-Agent: curl/7.65.3
> Accept: */*
>
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer

On https the log is the same as from this issue, but I’m on TLS 1.3:

❯ curl --verbose https://www.google.com
*   Trying 172.217.29.132:443...
* TCP_NODELAY set
* Connected to www.google.com (172.217.29.132) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to www.google.com:443
* Closing connection 0
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to www.google.com:443

I’ll report the logs as explained earlier, as well.

I’m on Windows Version 10.0.19041.207, WSL 2, Ubuntu 18.10 (but it also repros on Suse).

curl.exe works on Windows normally.

curl works when the vpn is not being used.