有关终端Github无法访问,connection timed out:443等问题


有关终端Github无法访问,connection timed out:443等问题

SSL_connect: Operation timed out in connection to github.com:443

  • 对于浏览器上Github可以使用[梯子]等方式,但是在终端中访问Github超时保443错误,网上为Git设置代理等等方式都不行,那么我们可以修改host文件。

  • 打开
    https://github.com.ipaddress.com/
    https://fastly.net.ipaddress.com/github.global.ssl.fastly.net#ipinfo
    https://github.com.ipaddress.com/assets-cdn.github.com

  • 等链接,将其中的IP地址复制下来,然后打开host文件,我用的是mac,可以从finder中command shift G直接访问/etc/host就可以了,没有权限修改的需要添加权限,然后将复制的IP地址粘贴进去。如下图

https://gitee.com/chanicaGo/chanica-images/raw/master/img/DAF422D2-45ED-4DED-B5C6-3F58D9623B40.png

然后打开终端,运行
sudo killall -HUP mDNSResponder;say DNS cache has been flushed
  • Problem solved!

参考

Git