gpt4 book ai didi

git - 使用 git 2.5 在 Windows 下的 git clone 上的 SSL3 错误

转载 作者:太空宇宙 更新时间:2023-11-03 13:25:38 26 4
gpt4 key购买 nike

我在 Windows 10 上使用 git,在 SSL 公司代理后面使用自签名证书绕过 cntlm,并将证书添加到自定义 curl-ca-bundle.crt 文件

从 Git 2.5 开始

git clone 'https://XXXX@bitbucket.org/XXXX/XXXX.git/'

我收到以下错误:

fatal: unable to access 'https://XXXX@bitbucket.org/XXXX/XXXX.git/':
error:14082174:SSL routines:ssl3_check_cert_and_algorithm:dh key too small

这个问题可能与自签名证书质量差有关,但我无法更改证书本身(这是我无法控制的)

请注意:

  • 如果您看到 XXXX 是安全/隐私的编辑值,但这不相关
  • 我无法重建自签名证书(这是我无法控制的)
  • 我已经尝试使用 git config https.sslVerify false(即使使用 --global 来确定...)
  • 使用以前的 git 版本不会发生这个问题

下面是我自己的配置:

git config --list

core.symlinks=false
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
diff.astextplain.textconv=astextplain
rebase.autosquash=true
http.proxy=http://localhost:9999
http.sslcainfo=c:/Users/XXXX/curl-ca-bundle.crt
https.proxy=https://localhost:9999
https.sslcainfo=c:/Users/XXXX/curl-ca-bundle.crt

有办法解决这个问题吗?

更新:

在@VonC 建议之后,我将设置更改为按项目设置使用。我将全局设置保留为默认设置并更改了每个项目的设置,但问题仍然存在。

那么,现在的设置如下:

全局设置:

core.symlinks=false
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
diff.astextplain.textconv=astextplain
rebase.autosquash=true

每个项目的设置:

core.symlinks=false
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
diff.astextplain.textconv=astextplain
rebase.autosquash=true
http.proxy=http://localhost:9999
http.sslcainfo=c:/Users/XXXX/curl-ca-bundle.crt
https.proxy=https://localhost:9999
https.sslcainfo=c:/Users/XXXX/curl-ca-bundle.crt

最佳答案

免责声明:此解决方案是无法根据上述建议使用正确解决方案的人们的最后希望。

请仅在您真正了解此解决方案涉及的所有影响和安全问题时使用

仅当您别无选择时才必须使用此解决方案,如果可能,请将您的 git 版本降级到 2.5 以下或等待 Git 2.6

作为第一个更好、更安全的解决方案,请查看以下来自 a VonC 的回复

如果您绝对需要一个快速的(但是,重复,错误)解决方案,可以按照以下在 Win 7 x64 和 Win 10 x64 上测试的步骤进行操作:

  1. http://www.openssl.org/community/binaries.html下载openssl-1.0.2-i386-win32.zip (win 32) 或 openssl-1.0.2-x64_86-win64.zip (win x64) 基于您的平台的预编译库。

  2. 将下载的文件解压到一个临时目录

  3. 将 c:\Program Files\Git\mingw64\bin\ssleay32.dll 重命名为其他名称(作为出现问题时的备份...)

  4. 将第1点解压出来的ssleay32.dll复制到c:\Program Files\Git\mingw64\bin\

这会将 SSL 库降级为接受小于 768 位的 DH key 的安全性较低的版本

关于git - 使用 git 2.5 在 Windows 下的 git clone 上的 SSL3 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32267593/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com