How I resolve "Downloading VS Code Server failed" while using vs code on MacOs

Solution 1:

If you are behind a proxy, create a file named .wgetrc in your home directory and add the following lines:

use_proxy=on
http_proxy=http://<my-proxy.company.net:port>
https_proxy=http://<my-proxy.company.net:port>

If needed, for one time, add:

check-certificate=off

Note: Disabling certificate check is not recommended as it can be a security threat.

Solution 2:

Add a line of :

check-certificate=off

to your .wgetrc file under the user's home directory.

Note: It will disable the SSL certificate check for all wget commands you use, unless you change it to :

check-certificate=on

Solution 3:

Configuring WSL behind proxy:

I will provide my solution that works for me.
In WSL subsystem add file in /etc/apt/apt.conf with proxy setting:

Acquire::http::Proxy "http://user:password@server_addr:port";
Acquire::https::Proxy "http://user:password@server_addr:port";

After that, add another setting in ~/.wgetrc file:

use_proxy = on
check_certificate = off
http_proxy = http://user:password@server_addr:port
https_proxy = http://user:password@server_addr:port
ftp_proxy = http://user:password@server_addr:port

After that, try to install the Visual Studio Code plugin for remote wsl.
It should work.