'Cannot push to github due to SSL_ERROR_SYSCALL

I can add and commit, but I cannot push to any repo. The error message goes like this: fatal: unable to access '[my github repo]': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

I re-installed git and got the same error. I tried to change repo, and even others' public repo, and got the same error, except the last three digits were a bit different - 403.

The problem happens to both Mac and Windows. I'm using Astrill VPN, but the problem exists even when I turn it off.

-- Update: --
I used git config --global --unset http.proxy and it worked, but after I pushed to this repo, I need to do it again to push to my friend's repo. So I think the question is, how to make git not set a proxy automatically after each push.



Solution 1:[1]

Check if you have:

  • a ~/.curlrc
  • a no_proxy environment variable defined. I have seen that SSL_connect: SSL_ERROR_SYSCALL in cases where the proxy was defined but should not have been used.

I think the question is, how to make git not set a proxy automatically after each push.

Set no_proxy to github.com:

export no_proxy=github.com

Even if a proxy is defined, it won't apply to push to GitHub because of the no_proxy environment variable.

Solution 2:[2]

If you still want to use a proxy then set https_proxy to the ip address and port of your choice like so: export https_proxy=ip_address:port

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Gwamaka Charles