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 "[email protected]"
  2. 查看公钥并复制

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

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

    shell 复制代码
    git clone [email protected]:username/repo.git

2.3 禁用 SSL 验证(不推荐)

不推荐的原因如下:

  1. 虽然可以临时禁用 SSL 验证来绕过这个问题,但这会降低安全性,因为它会使你的连接容易受到中间人攻击。
  2. 压根不起作用,临时禁用都不行,还是报错,艹
shell 复制代码
git config --global http.sslVerify false
相关推荐
難釋懷12 小时前
Android开发-常用布局
android·gitee
海尔辛16 小时前
学习黑客正经版Bash 脚本入门教程
chrome·学习·bash
江畔独步1 天前
Git 基础操作系列2: 本地项目上传至git仓库(gitee / gitlab / github)
git·gitee·gitlab
迷茫运维路2 天前
《企业级前端部署方案:Jenkins+MinIO+SSH+Gitee+Jenkinsfile自动化实践》
运维·前端·gitee·自动化·ssh·jenkins
海尔辛2 天前
学习黑客Bash 脚本
开发语言·学习·bash
alden_ygq4 天前
当K8S容器没有bash时7种高阶排查手段
容器·kubernetes·bash
vortex55 天前
深入理解 Bash 中的 $‘...‘ 字符串语法糖
开发语言·bash·excel
WenGyyyL6 天前
Android开发——实现一个计算器
gitee
ziqibit7 天前
Linux安全清理删除目录bash脚本
linux·bash
梦想画家10 天前
Bash 脚本:让数据库管理更高效
数据库·bash