解决git无法clone地址为https的库
一、问题描述
早上在学习《Spark快速大数据分析》的时候,需要下载书本的实例代码,于是用git clone一下给出的库:
https://github.com/databricks/learning-spark.git
结果,并不能成功克隆,最后的错误输出信息是“git https fatal: HTTP request failed”。
二、解决过程
上网找了一下,一种方案是用git:或者ssh:代替https:,譬如github官网给出的方案:https://help.github.com/articles/using-ssh-over-the-https-port/,按照这个去做而且成功了,然而并没什么卵用,出现了“Error: Permission denied (publickey)”,还是无法克隆。且罢。
于是还是继续用https链接,了解到原来git使用curl作为它的https传输客户端,需要设置一个环境变量:
export GIT_CURL_VERBOSE=1
https://github.com/databricks/learning-spark.git
还是有报错,首先是ping不通github.com,上网搜了一下可以设置为另一个地址:192.30.253.113,可以ping通,于是在/etc/hosts文件加上:
192.30.253.113 github.com
还有就是证书问题,设置一下:
git config --global http.sslverify true
git config --global http.sslCAPath /etc/pki/tls/certs
重新操作还是报错,这次是“failed to load from … CURLOPT_CAPATH”以及“NSS error -12286”,猜测是curl的配置问题。
最后通过一篇文章了解到应该是cipher的问题,https://bugs.centos.org/view.php?id=5620,其中有评论说到:
Yes there is and this is not a bug, it's just that in the latest version curl doesn't have RC4-SHA enabled by defaul.
按照里面说的方法测试了一下:
curl --cipher rsa_rc4_128_sha https://github.com/databricks/learning-spark.git
然后。。。表示没有这种cipher,最后提示“curl: (35) SSL connect error”,通过这个信息,找到另外一篇博文,说需要先升级nss:
yum update nss
升级完之后,重新克隆目标库,终于搞定!!!
三、参考
1. git and HTTPS (fatal: HTTP request failed)
2. Using SSH over the HTTPS port
3. curl: (35) SSL connect error的解决方法
(完)
解决git无法clone地址为https的库的更多相关文章
- 解决git无法clone提示443以及配置git代理方法
git config --global http.proxy 'socks5://127.0.0.1:1080' 设置完成之后再次clone就会成功了(当然前提是你有s's而且在开启的前提下)
- 解决git clone慢问题
解决git clone慢 关于Git克隆或是上传代码龟速的问题真是让人很恼火,这里对于网上的两种解决方案进行摘录. 利用码云克隆github项目 亲测有效 进入码云,新建一个仓库: 在创建的最后选择导 ...
- 小飞机可以解决git clone没有返回的问题吗?
[1]Linux如何使用小飞机? 以ss为例,先下载客户端: https://www.mediafire.com/folder/xag0zy318a5tt/Linux 下载客户端以后,右键把权限中&q ...
- 使用Bandwagon服务器ftp解决git clone速度慢的问题
写在前面 git clone速度往往很慢,我们可以先在身处美国的服务器上git clone,然后把文件用ftp传回来即可. 开始 我们以opencv为例 git clone https://githu ...
- 我的Git教程 之 解决 git clone后无代码
解决 git clone 后无代码 前言:这个教程只适用于像我一样大致理解Git的原理,但是不太记得住Git命令的同学使用.所以具体原理只会提一下,具体可以参见Pro Git. 在另一篇 简明的教程 ...
- 修改Git远程地址 git config remote.origin.url "https://..."
仓库管理: 添加或指定远程仓库地址 git remote set-url origin "https://..." git config remote.origin.url &qu ...
- 使用git svn clone迁移svn仓库
使用git svn clone迁移svn仓库 clone命令可以指定很多参数,主要用到这些,你也可以使用git svn help查看完整的参数列表. git svn clone https://172 ...
- 使用git svn clone迁移svn仓库(保留提交记录)
使用git svn clone迁移svn仓库 clone命令可以指定很多参数,主要用到这些,你也可以使用git svn help查看完整的参数列表. git svn clone https://172 ...
- 解决git报错:error: RPC failed; curl 18 transfer closed with outstanding read data remaining 的方法
报错信息: error: RPC failed; curl 18 transfer closed with outstanding read data remainingfatal: the remo ...
随机推荐
- linux 下apache 停止、重启等操作
基本的操作方法:本文假设你的apahce安装目录为/usr/local/apache2,这些方法适合任何情况 apahce启动命令:推荐/usr/local/apache2/bin/apachectl ...
- ORACLE用户的加锁、解锁
在DBA的日常工作中,经常遇到为Oracle用户解锁的操作:这篇文章给出在命令行下进行Oracle用户解锁的操作方法,通过几条简单的解锁语句就能完成此项工作.下面是具体的过程: 默认的scott用户是 ...
- 带ssl的websocket例子
还是在那个websocket_demo的例子 rebar-creator create-app websocket_demo tree一下看看大概目录 ├── cert │ ├── cowboy- ...
- AIDL初识
AIDL是一个缩写,全称是Android Interface Definition Language,也就是Android接口定义语言. AIDL的设计是为了实现进程间通信,如同两个进程的桥梁,传输一 ...
- java代码-----------继承练习
总结:父类和子类拥有相同的 方法时,父类的方法被覆盖,子类 package com.sads; class fong { void pprint() { this.print(); this.prin ...
- s=a+aa+aaa+aaaa+aa...a的值,其中a是一个数字。例如2+22+222+2222+22222(此时共有5个数相加),几个数相加由用户控制。
package com.hanqi; import java.util.*; public class yonghukongzhi { public static void main(String[] ...
- SHUTDOWN: waiting for active calls to complete
Problem Description: ==================== You are attempting to shut down the database and the data ...
- News Master-DC and Marvel they are super heroes mother
News Master Good evening everyone,I’m Jason,I’m glad to be news master to share something, Tonight I ...
- selenium+python+pycharm环境搭建
1.安装python,配置path环境变量,验证python安装成功与否 2.安装Pycharm:Pycharm是Python的IDE,所以我们需要安装一下:下载安装Selenium 3.在官网(ht ...
- vue+uwsgi+nginx部署项目
首先先下载好前后端项目 先从前端vue搞起 要在服务器上,编译打包vue项目,必须得有node环境 下载node二进制包,此包已经包含node,不需要再编译 wget https://nodejs.o ...