<!-- https://pkizerotohero.com/errors/vscode-self-signed-certificate-in-certificate-chain/ | Markdown mirror of the HTML page | PKI Zero to Hero, by Duyutech BV -->

> VS Code and Cursor extensions reject a corporate root the OS already trusts. Fix the extension host, remote servers and CLIs without turning TLS off.

Source: https://pkizerotohero.com/errors/vscode-self-signed-certificate-in-certificate-chain/ · Last reviewed: 2026-10-24

- VS Code, Cursor

# VS Code / Cursor: self signed certificate in certificate chain

Also seen in: GitHub Copilot, Cursor Tab, Cline, Continue, the GitLab and Sourcegraph extensions, Remote-SSH, WSL and dev containers

**In one sentence:**

The extension host inside VS Code or Cursor is a Node.js process with its own trust store, so a root the operating system trusts can still be missing there.

[Check yours: Chain checker](https://pkizerotohero.com/tools/chain/)

## Where you see it

VS Code and Cursor run extensions in the extension host, a separate Node.js process. When a request from it meets a [certificate chain](https://pkizerotohero.com/handbook/glossary/#certificate-chain) ending in a [self-signed certificate](https://pkizerotohero.com/handbook/glossary/#self-signed-certificate) it does not trust, OpenSSL returns verification error 19 and Node reports `SELF_SIGNED_CERT_IN_CHAIN`, in the extension’s Output channel, a chat pane or a notification. OpenSSL 3.0 hyphenated the message; 1.1.1 printed it as self signed certificate in certificate chain, so both spellings circulate.

```text
# Output panel, the failing extension's channel (Copilot Chat prints the same Node string)
Error: self-signed certificate in certificate chain
    code: 'SELF_SIGNED_CERT_IN_CHAIN'

# Cursor chat and agent, as users report it
[internal] self signed certificate in certificate chain
```

[SELF\_SIGNED\_CERT\_IN\_CHAIN](https://pkizerotohero.com/errors/node-self-signed-cert-in-chain/) covers the bare Node string; this page is about an editor that keeps printing it after the OS already trusts the root.

## What it means

One editor, three trust stores. The window is Chromium, which reads the operating system’s [trust store](https://pkizerotohero.com/handbook/glossary/#trust-store), so sign-in and web content work once IT installs the [root](https://pkizerotohero.com/handbook/glossary/#root-certificate). The extension host is Node, trusting only its bundled Mozilla roots unless VS Code adds the OS certificates: `http.systemCertificates` (default true) does that for the `https` module and `http.fetchAdditionalSupport` (default true) for the global `fetch`; a library with its own TLS socket, `ca` option or HTTP client misses both. Child programs such as git, npm and Claude Code apply their own rules; a remote session’s extension host runs on the remote machine.

## Likely causes

### A TLS-inspecting proxy the OS trusts but the extension host does not

A [TLS-inspection](https://pkizerotohero.com/handbook/glossary/#tls-inspection) proxy, a [man in the middle](https://pkizerotohero.com/handbook/glossary/#man-in-the-middle), re-signs every site with its own chain, so public hosts fail too. See which [issuer](https://pkizerotohero.com/handbook/glossary/#issuer) it presents:

```bash
openssl s_client -connect api.githubcopilot.com:443 -servername api.githubcopilot.com -showcerts </dev/null 2>/dev/null \
  | grep -E '^ *[0-9]+ s:|^ *i:|Verify return'
```

```text
 0 s:CN=api.githubcopilot.com
   i:CN=Corp Proxy Issuing CA
 1 s:CN=Corp Proxy Issuing CA
   i:CN=Corp Root CA
 2 s:CN=Corp Root CA
   i:CN=Corp Root CA
Verify return code: 19 (self-signed certificate in certificate chain)
```

A public [certificate authority](https://pkizerotohero.com/handbook/glossary/#certificate-authority) belongs on the `i:` line at depth 0; a corporate name confirms inspection, and the last `i:` line names the root. Export it as PEM from the store IT filled (on Linux the bundle already holds it):

```powershell
# Windows
certutil -store Root "Corp Root CA" corp-root.cer
certutil -encode corp-root.cer corp-root.pem
```

```bash
# macOS
security find-certificate -a -c "Corp Root CA" -p > corp-root.pem
```

If the OS store lacks it, start there: [Windows](https://pkizerotohero.com/guides/add-root-ca-windows/), [macOS](https://pkizerotohero.com/guides/add-root-ca-macos/), [Linux](https://pkizerotohero.com/guides/add-root-ca-linux/). Then check the settings that carry it into the extension host:

| Setting | Default | What it does |
| --- | --- | --- |
| `http.systemCertificates` | true | Adds OS certificates to `https` |
| `http.experimental.systemCertificatesV2` | false and marked experimental | Its description: “a more general approach” |
| `http.systemCertificatesNode` | true on the main branch, marked experimental and subject to server-side experiments | Uses Node’s `tls.getCACertificates('system')` |
| `http.proxyStrictSSL` | true | Keeps verification on |

`http.systemCertificatesNode` shipped in VS Code 1.106 (the October 2025 release); the Node call behind it has existed since Node.js 23.10.0 and 22.15.0. With the defaults intact, try the newer loader, then reload:

```json
{
  "http.systemCertificates": true,
  "http.proxyStrictSSL": true,
  "http.experimental.systemCertificatesV2": true
}
```

If one extension still fails, `NODE_EXTRA_CA_CERTS` (in Node.js since 7.3.0) appends a PEM file to Node’s bundled roots. It is read once at start-up: set it where the editor launches from and restart fully:

```powershell
setx NODE_EXTRA_CA_CERTS "C:\certs\corp-root.pem"
```

```bash
export NODE_EXTRA_CA_CERTS="$HOME/certs/corp-root.pem"
code .
```

`setx` reaches new processes only. Node ignores the file for a request with its own `ca` option, and an extension using the global `fetch` may not see it. GitLab Workflow documents this route: VS Code 1.101.2 and GitLab Workflow 6.51.1 or later, `http.systemCertificates` true, the chain’s [intermediates](https://pkizerotohero.com/handbook/glossary/#intermediate-certificate) in the system store too, `gitlab.ca` unset.

### Cursor’s HTTP/2 transport meets the proxy

Cursor shows the same `http.*` settings, though its documentation does not describe them; the steps above apply. Its chat and agent traffic uses HTTP/2 bidirectional streaming by default, with automatic fallback to HTTP/1.1 server-sent events, and its troubleshooting page says some corporate proxies block HTTP/2, which looks like a certificate failure. If chat fails while the Marketplace works, open Cursor Settings, then Network: click **Run Diagnostics**, set **HTTP Compatibility Mode** to **HTTP/1.1** and restart. That changes only the transport; install the root too. If only the Cursor CLI fails to sign in, update it: the Cursor CLI has added the operating system's trusted CA certificates to its bundled set for sign-in since v2026.09.15.

### Remote-SSH, WSL and dev containers read the remote’s store

The VS Code Server, a plain Node build on the remote machine, reads that machine’s bundle (the first of `/etc/ssl/certs/ca-certificates.crt`, `/etc/ssl/certs/ca-bundle.crt`, `/etc/ssl/ca-bundle.pem` and `/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem`); VS Code has reused local machine certificates in local dev containers and WSL sessions since 1.85 (the November 2023 release). Run the `openssl s_client` check there, install the root with the [Linux guide](https://pkizerotohero.com/guides/add-root-ca-linux/) and restart the server; if that is not enough, give the server the variable. For WSL, VS Code runs `~/.vscode-server/server-env-setup` first; an invalid Bourne shell script there stops the server starting:

```bash
cat >> ~/.vscode-server/server-env-setup <<'EOF'
export NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
EOF
```

Restart the distribution. For SSH, VS Code names no such file: export the variable where the server’s login shell sees it, then run **Remote-SSH: Kill VS Code Server on Host**. For a dev container, copy the root into the image, run `update-ca-certificates`, set `NODE_EXTRA_CA_CERTS` in `containerEnv` and rebuild.

### A child CLI brings its own runtime

A fix for the extension host does not reach programs started from it or the terminal. Claude Code’s `CLAUDE_CODE_CERT_STORE` defaults to bundled,system, so it reads the OS store as well as its bundled set (npm installs need Node 22.15 or later) and honours `NODE_EXTRA_CA_CERTS`: see [Claude Code](https://pkizerotohero.com/errors/claude-code-self-signed-cert-in-chain/). An MCP server inherits only the environment in its config file: [MCP server certificate errors](https://pkizerotohero.com/guides/mcp-server-certificate-errors/).

Warning

Why http.proxyStrictSSL false and NODE\_TLS\_REJECT\_UNAUTHORIZED=0 are traps

`"http.proxyStrictSSL": false` turns off certificate verification for every extension-host request; GitHub’s documentation says ignoring certificate errors “can cause security issues and is not recommended”. `NODE_TLS_REJECT_UNAUTHORIZED=0` does the same for every Node process that inherits it, and Node calls it strongly discouraged; GitLab’s `gitlab.ignoreCertificateErrors` is the same switch for one extension. Any device on the path can then present any certificate and take your tokens; install the root instead.

## Check yours

*Interactive tool: Chain checker (runs in the browser at [/tools/chain/](https://pkizerotohero.com/tools/chain/))*

Paste the output of `openssl s_client -showcerts`; the checker names the root and flags known inspection products.

## Learn why

- [Who do we trust? Trust stores](https://pkizerotohero.com/handbook/trust-stores/)
- [Certificate chains and path validation](https://pkizerotohero.com/handbook/certificate-chains/)
- Related: [Node.js](https://pkizerotohero.com/errors/node-self-signed-cert-in-chain/), [Claude Code](https://pkizerotohero.com/errors/claude-code-self-signed-cert-in-chain/), [corporate proxies](https://pkizerotohero.com/guides/corporate-proxy-certificates/), [Python and Node.js](https://pkizerotohero.com/guides/trust-ca-python-node/), [MCP servers](https://pkizerotohero.com/guides/mcp-server-certificate-errors/).
- VS Code: [Network connections](https://code.visualstudio.com/docs/setup/network), [WSL](https://code.visualstudio.com/docs/remote/wsl), [1.106 release notes](https://code.visualstudio.com/updates/v1_106), [request.ts](https://github.com/microsoft/vscode/blob/main/src/vs/platform/request/common/request.ts). Cursor: [network configuration](https://cursor.com/docs/enterprise/network-configuration), [troubleshooting](https://cursor.com/help/troubleshooting/network).
- Node.js: [NODE\_EXTRA\_CA\_CERTS](https://nodejs.org/api/cli.html#node_extra_ca_certsfile). GitHub: [Copilot network errors](https://docs.github.com/en/copilot/how-tos/troubleshoot-copilot/troubleshoot-network-errors). GitLab: [custom certificates](https://docs.gitlab.com/editor_extensions/visual_studio_code/ssl/).

**Early edition.** Written with AI assistance and checked against primary sources; an independent expert review is planned. Found a mistake? [Tell us](https://pkizerotohero.com/contact/?topic=content-error&page=/errors/vscode-self-signed-certificate-in-certificate-chain/).

Last reviewed 24 October 2026Edition 0.9

## Learn why it happens

- [Chapter 12: Who do we trust? CAs, trust stores and self-signed certificates](https://pkizerotohero.com/handbook/trust-stores/)
- [Chapter 13: Certificate chains and path validation](https://pkizerotohero.com/handbook/certificate-chains/)

## Everything on this topic

- [Chains and trust stores](https://pkizerotohero.com/topics/chains-and-trust/)
