远程服务器使用Copilot触发连接错误:自签名证书问题求助
GitHub Copilot 自签名证书错误问题解决
错误日志
2025-05-09 01:15:53.669 [info] [certificates] Removed 1 expired certificates 2025-05-09 01:16:11.407 [error] [default] Error sending telemetry FetchError: self-signed certificate at fetch (/home/ssl/.vscode-server/extensions/github.copilot-1.317.0/node_modules/@adobe/helix-fetch/src/fetch/index.js:99:11) at processTicksAndRejections (node:internal/process/task_queues:95:5) at cachingFetch (/home/ssl/.vscode-server/extensions/github.copilot-1.317.0/node_modules/@adobe/helix-fetch/src/fetch/index.js:288:16) at VB.fetch (/home/ssl/.vscode-server/extensions/github.copilot-1.317.0/lib/src/network/helix.ts:94:22) { type: 'system', _name: 'FetchError', code: 'DEPTH_ZERO_SELF_SIGNED_CERT', errno: undefined, erroredSysCall: undefined }
错误原因
该错误源于当前远程服务器的网络配置:服务器使用自签名SSL证书做流量拦截或代理,而GitHub Copilot的请求(此处为遥测数据发送)默认会验证SSL证书合法性,自签名证书不在系统默认信任列表中,因此触发证书验证失败。其他服务器可正常使用说明问题仅局限于当前服务器的网络/证书配置。
解决办法
1. 临时关闭SSL严格验证(应急方案)
在VS Code设置中添加以下配置,跳过证书验证:
"http.proxyStrictSSL": false
注意:此方法会降低网络安全性,仅建议临时测试使用。
2. 将自签名证书加入系统信任库(推荐方案)
Linux服务器操作步骤:
- 将自签名证书文件(如
custom-cert.pem)复制到系统证书目录:sudo cp custom-cert.pem /etc/ssl/certs/ - 更新系统信任证书:
sudo update-ca-certificates
完成后重启VS Code Server,Copilot会自动使用系统信任的证书。
3. 配置代理证书(若服务器使用代理)
如果服务器通过HTTP/HTTPS代理访问网络,在VS Code设置中指定代理证书路径:
"http.proxyCertificateFile": "/path/to/your/proxy-cert.pem"
内容的提问来源于stack exchange,提问作者小萝卜
相关产品推荐
相关产品推荐

