Repository navigation
Description
We have written the needed data into your clipboard because it was too large to send. Please paste.
Issue Type: Bug
I'm behind a company proxy so I usually need to add these settings when installing something for VScode.
When trying to install an extension in my container by using the .devcontainer.json file
{
"dockerFile": "Dockerfile",
"extensions": [
"ms-vscode.cpptools"
],
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
"settings": {
"http.proxyStrictSSL": false,
"http.proxy": "http://myproxy.com:81"
}
}Fails to actually use these settings or my own vscode settings to install through the proxy. From what I can tell these settings only apply within the container to install anything supplementary used by the extension (ie C++ needs to install 4 extra things). Weirdly if I try to install via the UI it works with no issue.
I think the codepath to install extensions within the container isn't respecting any proxy settings set in VSCode itself.
From the trace it also looks like it tries to install the extension via an IP Address instead of a url which is also explicitly blocked on our end.
When adding exports to my container
ENV http_proxy=http://myproxy.com:81 \
https_proxy=http://myproxy.com:81
I get an error self signed certificate in certificate chain :-(
Extension version: 0.66.0
VS Code version: Code 1.36.1 (2213894ea0415ee8c85c5eea0d0ff81ecc191529, 2019-07-08T22:56:38.504Z)
OS version: Darwin x64 18.6.0
Remote OS version: Linux x64 4.9.125-linuxkit
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz (8 x 2500) |
| GPU Status | 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on native_gpu_memory_buffers: enabled oop_rasterization: disabled_off protected_video_decode: unavailable_off rasterization: enabled skia_deferred_display_list: disabled_off skia_renderer: disabled_off surface_synchronization: enabled_on video_decode: enabled viz_display_compositor: disabled_off webgl: enabled webgl2: enabled |
| Load (avg) | 4, 3, 4 |
| Memory (System) | 16.00GB (0.02GB free) |
| Process Argv | -psn_0_2970325 |
| Screen Reader | no |
| VM | 33% |
| Item | Value |
|---|---|
| Remote | Dev Container |
| OS | Linux x64 4.9.125-linuxkit |
| CPUs | Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz (4 x 2492) |
| Memory (System) | 5.82GB (1.84GB free) |
| VM | 0% |
Activity
bsoudan commentedon Jul 17, 2019
Having the same issue, behind a MITM SSL proxy. Extra certificates are in fact installed in the container, and if I use a shell from inside the container, I can wget/curl https:// URLs just fine.
#587 is the exact problem I am seeing, but it was closed for some reason.
d-little commentedon Jul 17, 2019
Similar boat, container builds successfully and then hangs on TLSSocket errors when attempting to 'Install VS Code Server'
jabbera commentedon Jul 18, 2019
This isn't happening from in the container. VSCode is trying to download this file to your host, then copy it to the container. Setting: NODE_TLS_REJECT_UNAUTHORIZED=0 sorts it, but is horribly insecure.
Rhahkeem commentedon Jul 23, 2019
Probably not. But the fact I can't install using the
.devcontainer.jsonbut can do it via the UI shows there's definitely 2 different code paths being taken.Without setting the proxies in the container I just get
connect ECONNREFUSED 13.107.42.18:443Rhahkeem commentedon Jul 23, 2019
Was able to also reproduce this error when running on Windows.
midacts commentedon Jul 25, 2019
I'm getting this error as well.
Extension version: 0.66.0
VS Code version: Code 1.36.1
sandy081 commentedon Jul 29, 2019
Looks like the container spinning up is not updating the settings before installing extensions.
jabbera commentedon Jul 29, 2019
The issue is vscode does not respect the windows certificate store, it uses the node built in one and it doesn't support NODE_EXTRA_CA_CERTS:
electron/electron#10257 (comment)
If you set: NODE_TLS_REJECT_UNAUTHORIZED=0 it will download, but now I've just invalidated all of node TLS security./
Rhahkeem commentedon Jul 29, 2019
Yupp Mike Barry (@jabbera). Found that to be the case as well. On MacOS I just had to set the
ENV NODE_EXTRA_CA_CERTS=/path/to/certsin my Dockerfile. On Windows I had to setNODE_TLS_REJECT_UNAUTHORIZEDto 0. 👎EricHripko commentedon Jul 31, 2019
Just to clarify: On Windows you need both
NODE_EXTRA_CA_CERTSinside the container andNODE_TLS_REJECT_UNAUTHORIZEDnatively on Windows in order for Remote Container to boot up and install extensions successfully.midacts commentedon Jul 31, 2019
I might have done something wrong but I tried your steps with no avail.
On my Windows laptop i set this env variable as a system env variable
NODE_TLS_REJECT_UNAUTHORIZED = 0PowerShell example:
[Environment]::SetEnvironmentVariable("NODE_TLS_REJECT_UNAUTHORIZED", "0", "Machine")On the ubuntu container:
apt-get update && apt-get install ca-certificatesexport NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt26 remaining items
calcazar commentedon Dec 22, 2020
I'm getting the following:
when running the below in a docker container. The below is what VS code is automatically when starting up the development container
agucova commentedon Dec 31, 2020
I'm getting the exact same error under a normal connection (no proxy, no anything). I tried setting
NODE_TLS_REJECT_UNAUTHORIZEDin the host, setting upNODE_EXTRA_CA_CERTSon the Ubuntu container and updating the CA certificates with no avail.Remote Containers v0.154.1 and VSCode 1.52.1 under Ubuntu Desktop 20.10.
abid-mujtaba commentedon Apr 8, 2021
Seeing the same in VS Code 1.55.0 behind a corporate proxy:
Works via the UI.
chrmarti commentedon Apr 9, 2021
Abid H. Mujtaba (@abid-mujtaba) That is a different issue. Please check if VS Code 1.55.1 fixes it and file a new issue if it doesn't: https://github.com/microsoft/vscode/issues
abid-mujtaba commentedon Apr 10, 2021
Thanks Christof Marti (@chrmarti). Can confirm that updating to 1.55.1 fixed my issue.
lavaude commentedon May 19, 2021
Not sure if this is related, the message received on our side is a tiny bit different:
Same error whether we connect to WSL2 or a running docker container.
We are behind corporate proxy with authentication, as well as our own extra certificates.
chrmarti commentedon May 20, 2021
Edouard Lavaud (@lavaude) Could you open a new issue? This looks like a different problem. Thanks.
lucaspeixotot commentedon Sep 1, 2021
The same error here, someone knows how to fix it? I tried setting the env variables but it didn't work. My error is when I'm using remote-ssh to a remote development, from windows to Linux. My corporation uses the ZScaler.
[-]Extension installation ignores proxy settings [/-][+]Remote extension installation ignores proxy settings [/+]EricHripko commentedon Oct 19, 2021
My issue got about Remote - SSH (#5727) got merged into this one. I can see that folks here have found workarounds for container workflows, does anyone have any suggestions for Remote - SSH ones?
EricHripko commentedon Nov 11, 2021
In terms of Remote - SSH workflow, something must've changed in
1.62.0version of VS Code. It now appears to correctly followhttp.proxy*settings in Remote Settings.Austindgk232 commentedon Feb 4, 2023
rijulg commentedon Feb 24, 2023
What finally resolved the issue for me was setting Http: Proxy Support

http.proxySupportto on