VS Code Dev Containers: Configure NODE_EXTRA_CA_CERTS
Set NODE_EXTRA_CA_CERTS in the environment of VS Code's remote Node process using a readable in-container PEM file.
First place or mount the approved PEM CA file inside the dev container. The host browser's trust and host-only path do not provide certificate bytes to its Node process.
Then merge this into the existing .devcontainer/devcontainer.json for VS Code and related subprocesses:
"remoteEnv": {
"NODE_EXTRA_CA_CERTS": "/usr/local/share/certs/corporate-ca.pem"
}The path is inside the container. Rebuild/reopen through the Dev Containers lifecycle so the relevant Node process starts with it.
NODE_EXTRA_CA_CERTS extends Node's CA set at launch. Changing process.env afterward does not reload that set, and a client with an explicit ca option can choose a different trust source.
For a container-wide environment, use containerEnv with image/Dockerfile configuration or the Compose service environment, rather than assuming remoteEnv covers every process.
This supplies trust without NODE_TLS_REJECT_UNAUTHORIZED=0. Proxy selection remains separate: the CA cannot route a connection to the listener or repair an unreachable endpoint.