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
相关推荐
死磕音视频11 小时前
PowerPoint Copilot 入门:用 Interactive Slide 做出可点击讲解页
powerpoint·copilot·演示文稿·交互幻灯片
ms365copilot2 天前
Copilot 笔记本,研究内容整理完变成 PowerPoint
powerpoint·copilot
2501_916008892 天前
iOS App 图标、启动屏和多语言搭配 方法,上架前使用KXBuild一次做好 App 图标
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
2501_915918412 天前
iOS 推送通知怎么实现,从 APNs p8 密钥到 iOS 真机收到第一条推送
vscode·ios·objective-c·个人开发·swift·敏捷流程
sunshine22 girl2 天前
copilot vscode 使用技巧
人工智能·vscode·编辑器
2501_915909063 天前
Windows 打开 Xcode 工程,编译调试 Xcode 项目并和 Mac 同事协作
ide·windows·vscode·macos·ios·个人开发·xcode
孙琦Ray3 天前
GitHub 开源 Replica:用自家设计系统生成 AI 原型
开源·github·copilot·replica·设计系统·ai 原型
2501_916007473 天前
Windows OpenSSL 生成 iOS 证书,制作 p12 与描述文件,KXBuild 签名实操
windows·vscode·ios·objective-c·个人开发·swift·敏捷流程
我要见SA姐14 天前
Chrome 内存泄漏诊断指南:从现象定位到根因排查
ide·vscode·python·自动化·编辑器
00后程序员张4 天前
Windows 开发 iOS App 入门,用 SwiftUI 写第一个 iOS App 装到 iPhone
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程