无法访问“ https://github.com/xxx”: 连接到 github.com 的 OpenSSL SSL_connect: SSL_ERROR_SYSCALL: 443

当我尝试使用 git push时,一个错误报告:

致命: 无法访问‘ https://github.com/xxx’: OpenSSL 连接到 github.com 的 SSL _ connect: SSL _ ERROR _ SYSCALL: 443

我的 git 版本是2.16.2

在今天之前它工作得很好,重新安装 git 似乎不起作用。

有人能帮我吗? 先谢谢了!

190686 次浏览

After reinstalling Git did nothing, I found an issue on GitHub that helped me solve it.

In your terminal run this command first:

git config --global http.sslBackend "openssl"

Then this one:

git config --global http.sslCAInfo "C:\Program Files\Git\mingw64\ssl\cert.pem"

You may need to change your path depending on where you have it installed.

If you are behind a proxy, try the following:

git config --global --add remote.origin.proxy ""

Opening a new terminal session worked for me

I solved this same problem changing the git url in 'clone' step - use SSH instead of HTTPS link.

if your using proxy try to go to run and enter inetcpl.cpl then connections then Lan settings then advance and now you see your proxy, use the http one.

then open Git Bash then enter this command

$ git config --global http.proxy

if theres no output of it then the proxy in Git Bash is not set then set it with these command and use proxy and port shown in the 1st paragraph

$ git config --global http.proxy proxyaddress:port

then enter this command again

$ git config --global http.proxy

and there you go it is set

to reset the proxy on Git Bash just enter this command

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

i was also having these problem lately i was using psiphon vpn on desktop as a newbie it was also hard to find this solution glad i could help. :)

Sometimes, it can be simply because your system was unable to connect to GitHub, possibly because you were not connected to the Internet (or you had a lousy connection).

(It's true - this problem can be reproduced. Just disconnect your LAN/WiFi and then do git pull, you will get the same error).

PS: This happened with me. Sometimes the problem is your internet connection rather than configs.

I recently installed git 2.24.1 and not sure what changes I made, but it was not allowing me to clone or push without admin account on my machine.

This solved my issue:

  1. In your terminal run this command first:

    git config --global http.sslBackend "openssl"
    
  2. Then this one:

    git config --global http.sslCAInfo "C:\Program Files\Git\mingw64\ssl\cert.pem"
    
git config --global --add remote.origin.proxy "127.0.0.1:(proxy http port number)"

in ch

enter image description here

add image @afder cc's

I tried many answers and it still failed with the same error, including the following one:

git config --global http.sslBackend "openssl"

However, I tried reverting that by:

git config --global --unset-all http.sslBackend

then restart my laptop, and everything started working again.

I'm not exactly sure what went wrong initially, but lesson learned is that the correct config isn't the same for everyone.

For Shadowsocks users:

  1. Click the Shadowsocks icon, go Preferences:

enter image description here

  1. Suppose that your local proxy listen port is XXX, run this:
git config --global --add remote.origin.proxy "127.0.0.1:XXX"