Fix HTTPS connections in WSL2 if Windows is using VPN
Publish date: 2. December 2022
Last updated: 2. December 2022
Last updated: 2. December 2022
If you are using WSL and want to access an URL of a system which is only accessible via an active VPN, the connection might hang indefinitely.
This might be fixed by tweaking the MTU value.
In PowerShell, show the network interfaces: netsh interface ipv4 show subinterface
MTU Medienerkennungsstatus Bytes eingehend Bytes ausgehend Schnittstelle
------ --------------- --------- --------- -------------
4294967295 1 0 56179 Loopback Pseudo-Interface 1
1500 1 1425433040 53361775 WiFi
1500 5 0 0 Local Area Connection* 1
1500 5 0 0 Local Area Connection* 2
1500 5 0 0 Ethernet 2
1392 1 6047898 1832693 Ethernet 3
1500 1 20939 78939 vEthernet (WSL)
In my case, Ethernet 3 is the VPN connection; it might be different based on the VPN software used. The MTU in this case is 1392
Then in WSL, lis the interfaces with ip link list
. In my case eth0
is the local network interface.
Set the new MTU value with sudo ip link set dev eth0 mtu 1392
HTTPS connections should work now properly.
Related GitHub issue in WSL: