> 技术文档 > 解决 Failed to connect to github.com port 443 after 21066 ms: Could not connect to server

解决 Failed to connect to github.com port 443 after 21066 ms: Could not connect to server


一、问题描述

打开了 VPN,依然无法 git clone 来自 Github 上的仓库,报端口 443 错误

unable to access \'https://github.com/PeterFangXiaoLin/picture-system.git/\': Failedto connect to github.com port 443 after 21066 ms: Could not connect to server

错误分析:一般是在自己的电脑开发提交没有问题,在公司的电脑开发会有这种问题,可能公司的网络屏蔽了github的访问,这个时候可以尝试清除DNS缓存
已windows为例,执行下面的命令

ipconfig /flushdns

我上面的办法无效,最后的解决方案是换到 gitee因为配置代理的话,又连接不了公司自己内部的git,不能两全啊

二、解决办法

打开 设置 -> 网络和 Internet --> 打开代理
解决 Failed to connect to github.com port 443 after 21066 ms: Could not connect to server
解决 Failed to connect to github.com port 443 after 21066 ms: Could not connect to server

解决 Failed to connect to github.com port 443 after 21066 ms: Could not connect to server
执行以下命令(注意改成自己的)

git config --global http.proxy http://127.0.0.1:7897 git config --global https.proxy http://127.0.0.1:7897

我已经执行过了就不执行了
解决 Failed to connect to github.com port 443 after 21066 ms: Could not connect to server

再次 git clone 成功

三、总结

github 是容易被墙的,经过测试,上面的核心是执行两行 git config 命令, 打开 VPN 的本质就是开启代理,当关闭代理时,系统代理也跟着关闭,而端口号则取决于 Clash Verge 的端口
解决 Failed to connect to github.com port 443 after 21066 ms: Could not connect to server