【问题标题】:Cannot clone git repository via Git Bash无法通过 Git Bash 克隆 git 存储库
【发布时间】:2019-09-23 02:34:00
【问题描述】:

尝试使用git clone 克隆存储库时,它显示以下错误:

致命:无法访问 'https://github.com/microsoft/c9-python-getting-started.git/':OpenSSL 是在没有 SSLv2 支持的情况下构建的

Windows 10 x64 Home Single Language上使用最新的Git 2.23.0

刚开始我的 Git 之旅,请帮助我克服这个障碍。

【问题讨论】:

    标签: git github openssl certificate


    【解决方案1】:

    我只是在我自己的 W10 x64 PC 上克隆了它,没有任何问题

    D:\git>git version
    git version 2.23.0.windows.1
    
    D:\git>git clone https://github.com/microsoft/c9-python-getting-started/
    Cloning into 'c9-python-getting-started'...
    remote: Enumerating objects: 166, done.
    remote: Counting objects: 100% (166/166), done.
    remote: Compressing objects: 100% (136/136), done.
    
    Receiving objects: 100% (166/166), 3.11 MiB | 1.36 MiB/s, done.
    Resolving deltas: 100% (30/30), done.
    

    尝试将PortableGit-2.23.0-64-bit.7z.exe 解压缩到任何您想要的位置,看看设置简化的 PATH(仅用于测试,在 CMD 会话中)是否有帮助:

    set GIT_HOME=C:\Path\to\Git
    set PATH=%GIT_HOME%;%GIT_HOME%\bin;%GIT_HOME%\usr\bin;%GIT_HOME%\mingw64\bin;%PATH
    git clone https://github.com/microsoft/c9-python-getting-started/
    

    当然,您可能还有其他选择:使用 SSH URL 进行克隆

    git clone git@github.com:microsoft/c9-python-getting-started.git
    

    但首先了解 HTTPS 失败的原因会更有趣。

    phd 建议in the comments 代理问题,如curl/curl issue 1433 中所示。

    我在“Unknown SSL protocol error in connection”中提到了调试不稳定连接的各种方式,包括 2015 年第三季度 Git 2.6 http.sslVersion 设置,以强制 sslv3

    【讨论】:

    • 我怀疑 OP 和 Github 之间存在 HTTPS 代理。代理似乎使用的是过时的 SSLv2 协议。
    • @phd 我虽然仍然支持 SSLv2。我知道github.blog/2018-02-01-crypto-removal-notice
    • 上一段中提到的链接包含有用的信息。现在我在 http.sslversion 中只有 tlsv1.3
    【解决方案2】:

    我从.gitconfig 文件的[http] 标头中删除了以下行:

    sslVersion = sslv3
    sslVersion = sslv2
    

    它现在正在使用 https ?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-06-07
      • 2012-02-28
      • 1970-01-01
      • 1970-01-01
      • 2023-01-11
      • 2021-09-01
      • 2018-11-23
      • 2019-09-16
      相关资源
      最近更新 更多