Search code examples
windowsgitgithubkaspersky

Fatal: unable to access 'https://github.xxxx': Send failure: Connection was reset


I have the exact same issue as the person who asked this question: Fatal: unable to access 'https://gitlab.xxxx': Send failure: Connection was reset. They got it working again by disabling their antivirus.

When I attempt to execute git push -u origin main or git fetch, I encounter the following error:

fatal: unable to access 'https://github.com/...': Send failure: Connection was reset.

I've attempted the following troubleshooting steps:

  • disable everything in Kaspersky Total Security (all the "Essential Threat Protection", "Advanced Threat Protection", "Security Controls", and "Data Protection")
  • reset my network and tried two different ones as well
  • turn off IPv6 (restarted my computer as well)
  • re-install Git
  • create a new repository on GitHub
  • use Bitbucket instead of GitHub
  • uninstall Kaspersky VPN

Additionally, I executed the following commands sequentially:

git config --global http.sslVerify false
git config --global --unset http.proxy
git config --global --unset https.proxy
git config http.postBuffer 524288000

However, none of these solutions have worked for me. I would greatly appreciate any further suggestions.

(Note: I refrained from commenting on the original question or providing an answer due to my insufficient reputation, as Stack Overflow advises against asking questions within answer sections.)


Solution

  • Changing the GitHub authentication from HTTPS to SSH solved the problem for me. Here are the official instructions: https://docs.github.com/en/get-started/getting-started-with-git/managing-remote-repositories#switching-remote-urls-from-https-to-ssh