赞
踩
每次从github上clone代码的时候,总是会遇到SSL相关的报错:
OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
这是国内网络对境外访问的限制,所以解决方案也就是绕过这种限制。
一种最简单的解决方法就是使用ssh协议,以前在github的页面上会有一个ssh地址的链接,但是现在已经替换成了官方的Github CLI的地址,如果还是要用ssh地址访问怎么办?
官方其实保留了这种请求方式,只不过需要自己去拼接出ssh地址来。
Sometimes, firewalls refuse to allow SSH connections entirely. If using HTTPS cloning with credential caching is not an option, you can attempt to clone using an SSH connection made over the HTTPS port. Most firewall rules should allow this, but proxy servers may interfere.
$ ssh -T -p 443 git@ssh.github.com
如果收到以下回复,说明可以通过ssh协议访问github服务器
Hi USERNAME! You’ve successfully authenticated, but GitHub does not
provide shell access.
Note: The hostname for port 443 is ssh.github.com, not github.com.
之后就可以用拼接ssh地址来clone代码了
git clone ssh://git@ssh.github.com:443/YOUR-USERNAME/YOUR-REPOSITORY.git
参考:
Using SSH over the HTTPS port
Git - SSL_ERROR_SYSCALL 问题解决
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。