VSCode代理配置导致的SSL证书验证错误及解决方案

问题现象

遇到SSL证书验证错误:

复制代码
FetchError: Hostname/IP does not match certificate's altnames: 
Host: api.github.com. is not in the cert's altnames: DNS:draw.yxwl.asia

原因分析

  • 使用代理服务导致的证书验证问题
  • 请求被重定向到错误的服务器
  • DNS或网络配置问题

解决方法

  1. 在VSCode中配置代理:

    • 打开设置:Ctrl+Shift+P (Mac: Cmd+Shift+P)
    • 搜索并打开 settings.json
    • 选择 "Preferences: Open Default Settings (JSON)"
    • 添加以下配置:
    json 复制代码
    {
        "http.proxy": "http://127.0.0.1:7897",
        "https.proxy": "http://127.0.0.1:7897",
        "http.proxyStrictSSL": false,
        "github.copilot.advanced": {
            "proxy": "http://127.0.0.1:7897"
        }
    }
    • 将"7897"替换为实际的代理端口
    • 保存并重启VSCode
相关推荐
炘东59212 小时前
vscode连接算力平台
pytorch·vscode·深度学习·gpu算力
jedi-knight12 小时前
Vscode+CMake编译时出现中文乱码
ide·vscode·编辑器
许商1 天前
【stm32】cmake构建vscode开发环境
ide·vscode·编辑器
小-黯1 天前
VSCode+QT开发环境配置
ide·vscode·qt
xcs194051 天前
前端 开发vscode trae idea 热键
ide·vscode·intellij-idea
weixin_423196172 天前
使用vscode的ssh功能连接远程服务器卡在Setting up SSH Host IP: Downloading VS Code Server的解决方案
服务器·vscode·ssh
沉木渡香2 天前
VSCode中Java开发环境配置的三个层级(Windows版)1-3
java·windows·vscode
开心-开心急了2 天前
Windows 解决vscode 无法激活 miniconda 虚拟环境问题
windows·vscode·conda
fenghx2582 天前
vscode使用arcpy-选择arcgis带的python+运行错误解决
vscode·python·arcgis
夜晓码农3 天前
VSCode Web版本安装
前端·ide·vscode