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
相关推荐
小毛驴8508 小时前
Visual Studio Code (VSCode) 的常用快捷键
ide·vscode·编辑器
C++ 老炮儿的技术栈10 小时前
在vscode 如何运行a.nut 程序(Squirrel语言)
c语言·开发语言·c++·ide·vscode·算法·编辑器
SHUIPING_YANG1 天前
vscode cursor配置php的debug,docker里面debug
vscode·docker·php
William.csj1 天前
VSCode——插件分享:Markdown PDF
vscode·pdf·markdown
霖001 天前
深入讲讲异步FIFO
笔记·vscode·单片机·嵌入式硬件·学习·fpga开发
淮北4942 天前
STL学习(十一、常用的算数算法和集合算法)
c++·vscode·学习·算法
月光有害2 天前
PL-0功能拓展及基于VSCode的IDE配置
ide·vscode·编辑器
*wj2 天前
【linux驱动开发】Vscode + Remote SSH + clangd + bear=内核源码阅读环境搭建
linux·驱动开发·vscode
Chensf20212 天前
用latex+vscode+ctex写毕业论文
vscode·论文·latex·ctex
技术路上的探险家2 天前
Web3:在 VSCode 中基于 Foundry 快速构建 Solidity 智能合约本地开发环境
vscode·web3·智能合约·solidity·foundry