【问题标题】:Can't clone https repositories even though curl works for https pages即使 curl 适用于 https 页面,也无法克隆 https 存储库
【发布时间】:2013-11-13 14:18:51
【问题描述】:

我已经尝试了所有方法,但似乎仍然无法通过 https 克隆 git 存储库,即使获取 https 页面没有问题。

cURL 版本:

$ curl --version 
curl 7.21.7 (amd64-pc-win32) libcurl/7.21.7 OpenSSL/0.9.8r zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtsp
smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate Largefile NTLM SSL SSPI libz 

尝试克隆 https 仓库:

$git clone https://github.com/SublimeText/LaTeXTools.git
Cloning into 'LaTeXTools'...
error: Protocol https not supported or disabled in libcurl while accessing https
://github.com/SublimeText/LaTeXTools.git/info/refs?service=git-upload-pack
fatal: HTTP request failed

适用于 https 页面没问题:

$ curl -L https://www.google.com
<!doctype html><html 
...
</script></body></html>

有什么建议吗?谢谢!

【问题讨论】:

    标签: git curl https


    【解决方案1】:

    git 使用的 libcurl.dll 可能与您的命令行 curl 不同。确保您的 %PATH% 上没有任何其他 libcurl.dll 构建,来自您已安装的其他东西,只是与 git 捆绑的那个。

    【讨论】:

      【解决方案2】:

      这可能是两个不同的curl版本之间的冲突(一个默认安装在系统上,一个实际使用由于你的路径)

      你可以看一个例子in this thread:

      由于某种原因,/usr/local/bin 中安装了 curl,而我的 $PATH 以“/usr/local/bin:/usr/bin: ...”开头。
      我所做的是我删除了/usr/local/bin/curl,然后在/usr/local/bin/curl (ln -s /usr/bin/curl /usr/bin/local/curl) 处创建了指向/usr/bin/curl 的符号链接,然后我删除了/usr/local/lib 中的所有curl 库。

      您可以在“How do I enable https support in libcurl?”中看到相同类型的问题(这次是在 Mac 上)。

      【讨论】:

        【解决方案3】:

        我猜原因是 libcurl.dll 之间的冲突是的。万一有人从谷歌或类似的网站上偶然发现了这个,我的解决方案就像卸载并再次安装 Git 一样简单。成功了。

        不过,感谢其他答案。干杯。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2023-01-11
          • 1970-01-01
          • 2014-03-12
          • 1970-01-01
          • 2020-09-21
          • 1970-01-01
          • 2012-10-03
          相关资源
          最近更新 更多