我使用的是 RedHat 5.2,我需要从 Github 克隆一个存储库。遗憾的是,自今年 2 月 1 日起,他们禁用了 TLSv1 和 TLSv1.1
不幸的是,Red Hat 5 没有支持 TLSv1.2 的单点版本。我们建议 Red Hat 5 用户升级到更新版本的操作系统。
我能够获取源代码OpenSSL 1.0.2a 19 Mar 2015
并构建它,然后curl-7.58.0
使用较新的 OpenSSL 进行编译。我还使用较新的 OpenSSL 和 curl 编译了较新的 git
$ curl --version
curl 7.58.0 (i686-pc-linux-gnu) libcurl/7.58.0 OpenSSL/1.0.2a zlib/1.2.3
Release-Date: 2018-01-24
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy
$git --version
git version 2.16.2
我可以在curl
Github 上
# curl -Ivvv -k https://github.com
* Rebuilt URL to: https://github.com/
* Trying 192.30.253.113...
* TCP_NODELAY set
* Connected to github.com (192.30.253.113) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
* subject: businessCategory=Private Organization; jurisdictionC=US; jurisdictionST=Delaware; serialNumber=5157550; street=88 Colin P Kelly, Jr Street; postalCode=94107; C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=github.com
* start date: Mar 10 00:00:00 2016 GMT
* expire date: May 17 12:00:00 2018 GMT
* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 Extended Validation Server CA
* SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
但我无法从中克隆
$ env GIT_TRACE=2 git clone --verbose https://github.com/torvalds/linux.git
12:02:58.696627 git.c:344 trace: built-in: git 'clone' '--verbose' 'https://github.com/torvalds/linux.git'
Cloning into 'linux'...
12:02:58.697620 run-command.c:627 trace: run_command: 'git-remote-https' 'origin' 'https://github.com/torvalds/linux.git'
我还尝试初始化一个新的存储库并将 Github 链接设置为源,但它也不起作用。
我是否在某处缺少设置或标志?
谢谢
答案1
在 RHEL 5 上,我使用 Epel 5 中的 git-1.8.2.3-1.el5:
# rpm -qi git
Name : git Relocations: (not relocatable)
Version : 1.8.2.3 Vendor: Fedora Project
Release : 1.el5 Build Date: Di 26 Apr 2016 19:30:16 CEST
似乎需要 OpenSSL 1:
# ldd /usr/bin/git-remote-https
libssl.so.10 => /lib/libssl.so.10 (0x00b2a000)
libcrypto.so.10 => /lib/libcrypto.so.10 (0x00595000)
在我的系统上,它是这样解决的:
# rpm -qf /lib/libssl.so.10
openssl1-1.0.1e-57.el5_11
这个来自“tuxad repo”: https://unix.stackexchange.com/a/459187/284960
我对从 github 克隆没有任何问题。