Open channyein87 opened 8 months ago
Check out #5032.
Alternatively #5135 #4978 -- don't download language servers in the first place, let people use their existing ones.
I hope this will be the way going forward as language support is moved out into extensions more.
I still see this issue on Zed Preview 0.137.0 with the patch from #11852.
In this case when I load a python project and it attempts to install the pyright
LSP:
2024-05-23T10:17:56+12:00 [ERROR] failed to start language server "pyright": failed to execute npm info subcommand:
stdout: "{\n \"error\": {\n \"code\": \"SELF_SIGNED_CERT_IN_CHAIN\",\n \"summary\": \"request to https://registry.npmjs.org/pyright failed, reason: self-signed certificate in certificate chain\",\n \"detail\": \"\"\n }\n}\n"
stderr: "npm ERR! code SELF_SIGNED_CERT_IN_CHAIN\nnpm ERR! errno SELF_SIGNED_CERT_IN_CHAIN\nnpm ERR! request to https://registry.npmjs.org/pyright failed, reason: self-signed certificate in certificate chain\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR! /Users/<>/Library/Application Support/Zed/node/node-v18.15.0-darwin-x64/cache/_logs/2024-05-22T22_17_49_373Z-debug-0.log\n"
This is on a device with a (transparent) forward proxy and custom SSL certificates.
Setting cafile to custom certificates bundle is what I use to get npm
package installs to work (Setting NODE_EXTRA_CA_CERTS also works.) I.E.
$ cat ~/.npmrc
cafile=/etc/ssl/cert.pem
...
+1.
NODE_EXTRA_CA_CERTS
environment variable should be forwarded to npm.
Im not sure why this issue was closed, this is still a problem.
I took a look at the source and this is definitely not something you can get around: https://github.com/zed-industries/zed/blob/f39805d529d580ba152f10b4a00419d4cfb6f04c/crates/node_runtime/src/node_runtime.rs
The code here create a blank config file every time it uses npm. It also clears the env variables so those are also not read. I assume they do that to prevent any conflict with a local npm config file but in this case it means there is no way to set the cafile for Zed's npm.
Check for existing issues
Describe the bug / provide steps to reproduce it
My compnay uses forward proxy with custom SSL cert. Is there a way to trust the company's CA chain for langugage servers?
Environment
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your
~/Library/Logs/Zed/Zed.log
file to this issue.If you only need the most recent lines, you can run the
zed: open log
command palette action to see the last 1000.No response