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
相关推荐
q***725618 小时前
vscode配置django环境并创建django项目(全图文操作)
vscode·django·sqlite
saber_andlibert18 小时前
【Linux】Shell脚本
运维·chrome·vscode·编辑器·vim·shell
. . . . .1 天前
VSCode终极版
ide·vscode·编辑器
饮品爱好者1 天前
[C#] NO.4 我的第一个项目
vscode·职场和发展·c#·github
我的golang之路果然有问题1 天前
mac配置 unity+vscode的坑
开发语言·笔记·vscode·macos·unity·游戏引擎
WKJay_1 天前
VSCode 1.106 版本发布 —— 更强 AI 特性,更丝滑的编程体验!
ide·人工智能·vscode
MicrosoftReactor1 天前
技术速递|GitHub Copilot 和 AI Agent 如何拯救传统系统
人工智能·github·copilot·agent
abiao19812 天前
如何在 VSCode 中创建 Vue 项目
ide·vue.js·vscode
应用市场2 天前
ARM编译器深度解析:从Keil到VSCode的STM32开发之
arm开发·vscode·stm32
初遇你时动了情2 天前
flutter vscode 终端无法使用fvm 版本切换、项目运行
ide·vscode·flutter