microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.56k stars 267 forks source link

Add Dev Container Configuration Files behind corporate proxy -> unable to get local issuer certificate #9361

Open Roemer opened 6 months ago

Roemer commented 6 months ago

We have the an issue that just creating the dev-container configuration files locally (or when connected to the remote WSL2) does not work, It always immediately aborts with the error:

[error] Error: unable to get local issuer certificate
    at TLSSocket.onConnectSecure (node:_tls_wrap:1543:34)
    at TLSSocket.emit (node:events:513:28)
    at TLSSocket._finishInit (node:_tls_wrap:962:8)
    at ssl.onhandshakedone (node:_tls_wrap:746:12) remote-containers.createDevContainerFile {"value":"ms-vscode-remote.remote-containers","_lower":"ms-vscode-remote.remote-containers"}

I do have the NODE_EXTRA_CA_CERTS set to our certificates on Windows but that seems not to help. The last version of the Dev Containers extension that this still works is 0.255.4 but everything newer (up to the pre-release 0.329.0) fails with the error mentioned above. I went thru all open issues related to similar issues but most of them are regarding issues with installing extensions on the remote / container which we don't have if we just add the NODE_EXTRA_CA_CERTS and the certificates into the container as well. The only really matching issue is https://github.com/microsoft/vscode-remote-release/issues/8230 which is closed but it still does not work for us.

Steps to Reproduce:

  1. Be on corporate proxy
  2. Try to create new dev container configuration files locally
Roemer commented 6 months ago

I now tried with setting the environment variable NODE_TLS_REJECT_UNAUTHORIZED to 0 in Windows and that actually made it work. This is a workaround but I don't see any reason why it should not work when NODE_EXTRA_CA_CERTS is set to a .pem file with all corporate certificates.