error: "unable to get local issuer certificate" behind zScaler proxy #8866
-
My company is using zScaler proxy, which is intercepting TLS. The root certificate is installed in the system and all browsers and command line tools like curl work fine. Only VS Code extensions like Copilot have a problem. The full error is:
I've seen in microsoft/vscode#45792 (comment) that VS Code is already using the system's certificates, however chrmati suggests in microsoft/vscode#124655 (comment) that contrary to browsers VS Code might not download any missing certificates of the certificate chain. This might be the root cause. I've already added the complete certificate chain for vscode-auth.github.com and copilot-proxy.githubusercontent.com to the system, but it made no difference. Setting
|
Beta Was this translation helpful? Give feedback.
Replies: 24 comments 83 replies
-
Please try adding |
Beta Was this translation helpful? Give feedback.
-
Done. But it makes no difference, unfortunately. |
Beta Was this translation helpful? Give feedback.
-
Following back up on this, was there any resolution to this issue? This only seems to effect the VSCode version of the plugin. |
Beta Was this translation helpful? Give feedback.
-
I don't know why, but whatever process the extension uses doesn't respect NODE_EXTRA_CA_CERTS I spent probably more time than I really should have spelunking in the chucking this at the top of const tls = require("tls");
const fs = require("fs");
const origCreateSecureContext = tls.createSecureContext;
tls.createSecureContext = options => {
const context = origCreateSecureContext(options);
const pem = fs
.readFileSync(process.env.NODE_EXTRA_CA_CERTS, { encoding: "ascii" })
.replace(/\r\n/g, "\n");
console.log(pem);
const certs = pem.match(/-----BEGIN CERTIFICATE-----\n[\s\S]+?\n-----END CERTIFICATE-----/g);
if (!certs) {
throw new Error(`Could not parse certificate ${process.env.NODE_EXTRA_CA_CERTS}`);
}
certs.forEach(cert => {
context.context.addCACert(cert.trim());
});
return context;
}; |
Beta Was this translation helpful? Give feedback.
-
Well, this is clearly not a problem they want to solve and instead actually appear to be actively going out of their way to make it hard to address. It's still possible to set rejectUnauthorized to false in places, but a) there's no easy find replace to do that, and b) I'm tired of telling them exactly where to go to break the fixes. |
Beta Was this translation helpful? Give feedback.
-
I fixed it with following speps:
This takes a minute to figure out which part of the code can be replaced. This is not an ideal solution, but should work. Thanks to @PatrickKennedy for the hint with |
Beta Was this translation helpful? Give feedback.
-
Just installing the win-ca extension solved this for me. Kudos to @Stevendeleon |
Beta Was this translation helpful? Give feedback.
-
I asked my infra team to exclude the following from SSL inspection - worked a charm:
|
Beta Was this translation helpful? Give feedback.
-
Although this is geared towards VS Code, alternatively if you have access to JetBrains IDEs (as a fallback) their software will pick up untrusted certs from installed plugins and prompt you to accept upon startup: Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Hey everyone please join discussion here and vote also here. It's diff topic but requires attention to improve DX. |
Beta Was this translation helpful? Give feedback.
-
For those who still have this issue with your company laptop and still cant solve it, install win-ca extension in vscode and change the win-ca setting to append. It worked for me. |
Beta Was this translation helpful? Give feedback.
-
I'm using MacOS so |
Beta Was this translation helpful? Give feedback.
-
For those of you wanting a fix for Jetbrains Intellij / Webstorm, and you didn't get a prompt to
|
Beta Was this translation helpful? Give feedback.
-
Win-ca worked for the windows VSC instance. but has anyone found out how to solve it when using WSL(ubuntu) in VSC? |
Beta Was this translation helpful? Give feedback.
-
For Mac users, please try https://marketplace.visualstudio.com/items?itemName=linhmtran168.mac-ca-vscode After installing this extension, GitHub copilot works like a charm in my vscode! |
Beta Was this translation helpful? Give feedback.
-
Is it working for intelij ides? |
Beta Was this translation helpful? Give feedback.
-
I tried with VSCODE and it works like a charm.
…On Thu, Oct 13, 2022 at 10:06 AM Micael ***@***.***> wrote:
Is it working for intelij ides?
—
Reply to this email directly, view it on GitHub
<#8866 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJIPNVA4QU2AYOZ7C2EGMRTWDA6TDANCNFSM5KDF2RCA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
jetbrains rider copilot latest, still not working: Sign in failed. Reason: Request signInInitiate failed with message: No instance of has been registered. Context created at: at new (C:\snapshot\copilot\dist\agent.js) at C:\snapshot\copilot\dist\agent.js at C:\snapshot\copilot\dist\agent.js at C:\snapshot\copilot\dist\agent.js at C:\snapshot\copilot\dist\agent.js at Object. (C:\snapshot\copilot\dist\agent.js) at Module._compile (pkg/prelude/bootstrap.js:1930:22) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) , request id: 4, error code: -32603 |
Beta Was this translation helpful? Give feedback.
-
This issue is huge. You cannot use Github Copilot behind a zscaler without strange modifications. I had the issue under Windows and Linux in VScode, JetBrains and nvim.
Proposed solution: Allow importation of zscaler certifcates with copilot no matter in which environment and mark is as trusted (like you would do in a browser) |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
If you're familiar with Docker, there's a solution. There is a docker image of the famous Squid proxy that we are familiar with. And go to Jetbrains IDE such as IntelliJ, WebStorm, Pycharm, etc. and go to It works well in my environment (Windows 10, Under Zscaler 4.0.0.X, WebStorm 2023.1 Build #WS-231.8109.174, built on March 28, 2023). Enjoy. |
Beta Was this translation helpful? Give feedback.
-
With me, it was because of JamF 20.87.225.211 api.github.com |
Beta Was this translation helpful? Give feedback.
-
I solved the problem as follows in this environment:
Solution
|
Beta Was this translation helpful? Give feedback.
-
When using VDI, I encountered a self-signed certificate issue (I find VDI environments similar to internal corporate VPNs). My development environment is Windows 11 (VDI) with IntelliJ IDEA 2024. I resolved it by following these steps:
Now your GitHub Copilot should work. |
Beta Was this translation helpful? Give feedback.
I asked my infra team to exclude the following from SSL inspection - worked a charm: