报错信息:
- Failed to connect to github.com port 443
- OpenSSL SSL_read: Connection was reset, errno 10054
错误解析:
不是这个:【git 权限认证失败】(不是)
真~解析:可能是以下两种情况导致(2问题可能同时存在,也可能还有其它问题):
- 命令行状态下被墙了网址,导致连接到远程库超时或直接失败。
- 古老的权限记录问题:C/Users/admin/. ssh/known_hosts(打开此文件,直接搜索github,把相应列删除,然后随便Clone一个Git地址,里面填yes即可解决)
解决方案:
找到如下文件,并使用记事本相关的文本应用进行编辑:
- Windows: C:\Windows\System32\drivers\etc\hosts
- Mac: ~\etc\hosts
在新的行键入以下代码:
192.30.255.112 github.com git
185.31.16.184 github.global.ssl.fastly.net
解决方案分析:
将域名解析变为IP地址解析。
其实很多有很多类似的,比如Mac下的Cocoapods,npm库引用等。
引申:
分享一个hosts文件:
1 2 3 4 5 6 7 8 |
# fixed https://githubusercontent.com.ipaddress.com/raw.githubusercontent.com - Githubusercontent Website # 185.199.108.133 raw.githubusercontent.com 199.232.68.133 raw.githubusercontent.com # unity upm load git error fix: 192.30.255.112 github.com git 185.31.16.184 github.global.ssl.fastly.net 192.168.56.1 windows10.microdone.cn |