windows:curl: (60) schannel: SEC_E_UNTRUSTED_ROOT (0x80090325)

目录

  • [1. git update-git-for-windows 报错](#1. git update-git-for-windows 报错)
  • [2. 解决方案](#2. 解决方案)
    • [2.1. 更新 CA 证书库](#2.1. 更新 CA 证书库)
    • [2.2. 使用 SSH 连接(推荐)](#2.2. 使用 SSH 连接(推荐))
    • [2.3 禁用 SSL 验证(不推荐)](#2.3 禁用 SSL 验证(不推荐))

1. git update-git-for-windows 报错

shell 复制代码
Lenovo@LAPTOP-EQKBL89E MINGW64 /d/YHProjects/omni-channel-recon-dev (master)
$ git update-git-for-windows
curl: (60) schannel: SEC_E_UNTRUSTED_ROOT (0x80090325) - More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the webpage mentioned above.
  • 操作:windows环境使用git update-git-for-windows从我自己的gitee仓库更新代码。
  • 报错信息:curl 在尝试与服务器建立安全连接时,无法验证服务器的 SSL 证书。这可能是因为服务器使用了自签名证书,或者证书链中的某个证书不被客户端信任。
    简而言之:我的本机(即本地 Git 客户端)拒绝验证远程服务器的 SSL 证书

2. 解决方案

2.1. 更新 CA 证书库

Windows操作系统通常会通过Windows Update自动更新根证书。

确保我的操作系统或 Git 客户端的 CA 证书库是最新的,这样可能会包含远程服务器证书的签发机构。

但是我的Windows11确实已经是最新版的了,并且我想起来了,我昨天下班的时候更新了一下Windows,下班之前我都还能正常用git拉项目,更新之后就不行了

至于去使用gitee的CA证书,于我而言就不现实了,我根本拿不到。

2.2. 使用 SSH 连接(推荐)

使用 SSH 而不是 HTTPS 来克隆或更新代码。SSH 方式不需要依赖 SSL 证书验证,通常更安全。

  1. 生成SSH密钥

    shell 复制代码
    ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
  2. 查看公钥并复制

    shell 复制代码
    cat ~/.ssh/id_rsa.pub
  3. 将复制的公钥放到个人------设置------SSH公钥下

  4. 重新clone,但是选择仓库的ssh地址来进行克隆

    shell 复制代码
    git clone git@gitee.com:username/repo.git

2.3 禁用 SSL 验证(不推荐)

不推荐的原因如下:

  1. 虽然可以临时禁用 SSL 验证来绕过这个问题,但这会降低安全性,因为它会使你的连接容易受到中间人攻击。
  2. 压根不起作用,临时禁用都不行,还是报错,艹
shell 复制代码
git config --global http.sslVerify false
相关推荐
0x000711 小时前
Git Bash 中无法启动 Claude Code ?
开发语言·git·bash
晨晖211 小时前
项目上传到gitee的两种方式,ssh和https
https·gitee·ssh
IMPYLH12 小时前
Linux 的 users 命令
linux·运维·服务器·前端·数据库·bash
IMPYLH1 天前
Linux 的 whoami 命令
linux·运维·服务器·bash
IT大白鼠1 天前
Linux用户配置文件详解:.bash_history、.bash_logout、.bash_profile与.bashrc
linux·运维·bash
承渊政道2 天前
Linux系统学习【进程概念从入门到深入理解】
linux·服务器·笔记·学习·ubuntu·系统架构·bash
IMPYLH2 天前
Linux 的 wc 命令
linux·运维·服务器·前端·bash
Soari3 天前
【紧急发布】Claude Code v2.1.148 :修复 Bash 127 瘫痪 Bug,/simplify 升级为 AI 代码评审
人工智能·bug·bash·claudecode
chushiyunen3 天前
gitignore常用配置
gitee
效能革命笔记3 天前
Gitee DevSecOps 智能版本管理:军工软件工厂的依赖治理与供应链安全方案
网络·安全·gitee