解决方案>OpenSSL SSL_connect: Connection was reset in connection to github.com:443

124 阅读1分钟

问题现象:

ferren@DESKTOP-R2MBPRO MINGW64 /e/me/code/other/project
$ git clone https://github.com/xxxxxx.git
Cloning into 'xxxxxx'...
fatal: unable to access 'https://github.com/xxxxxx.git/': OpenSSL SSL_connect: Connection was reset in connection to github.com:443

如果开启了VPN,很可能是因为代理的问题,这时候设置一下http.proxy就可以了。

一定要查看自己的VPN端口号,假如你的端口号是7890,在git bash命令行中输入以下命令即可:

git config --global http.proxy 127.0.0.1:7890
git config --global https.proxy 127.0.0.1:7890

如果你之前git中已经设置过代理配置,则使用如下命令取消代理配置即可:

git config --global --unset http.proxy
git config --global --unset https.proxy

下面是几个常用的git配置查看命令:

git config --global http.proxy #查看git的http代理配置
git config --global https.proxy #查看git的https代理配置
git config --global -l #查看git的所有配置