- git clone https://github.com/xxxx/lilxxy.git
- Initialized empty Git repository in /tmp/clone123/lxyily/.git/
- error: while accessing https://github.com/xxxx/lxyily.git/info/refs
- fatal: HTTP request failed
这个报错的原因可以能是:
1, 服务器时间问题
2,git 版本问题
3,curl 版本问题
对于 3, 因为 git 在连接的时候内部其实是 curl 来连接. 通过 curl https://xxxx/ 发现也是报错, 发现 ssl 连接有问题
通过可以 git clone 的服务器对比发现出现故障的服务器的 curl 版本不一样. 所以更新 curl
yum update -y nss curl libcurl
这里 nss 是默认使用 ssl 认证方式, 当然也可以改成 openssl 的方式. 查看是否是 nss 或者 OpenSSL 认证的方式为
- curl -V
- curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz
如果需要改成 OpenSSL 的方式, 可以参考网络上的
https://www.cnblogs.com/showker/p/4706271.html
来源: http://www.bubuko.com/infodetail-2630489.html