40
fatal: unable to access 'https://github.com/XXX/XXXXX.git/': OpenSSL SSL_connect: Connection was reset in connection to github.com:443

Suddenly I'm getting above error while I try to git pull, git push, or clone the repo.

Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
Ronak Dumaniya
  • 835
  • 6
  • 13
  • 20

13 Answers13

34

I also encountered a similar situation; that's when I came across an answer on Code Grepper by Shibbir Ahmed, where he provided this:

git config --global --unset-all remote.origin.proxy

That solved the issue for me.

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
Rahmlad Aramide
  • 472
  • 4
  • 5
23

When I couldn't use my VPN Apps because it doesn't connect in Iran at the moment, I used GitHub desktop.

Amir Aghajani
  • 367
  • 2
  • 5
21

As Iranian Govenment has recently blocked OpenSSL protocol in most ISPs, we have to switch from HTTPS to SSH or use Github Desktop (This solution is just for Iranian people like me!).

I recommend installing GitHub Desktop if you can. I couldn't install it since I want to use GIT in the terminal. So, I switched from HTTPS mode to SSH mode using this command (Reference):

git config --global url."git@github.com:".insteadOf "https://github.com/"

Then I created an SSH key and added it to ssh agent using this tutorial on github.

Also, to test your ssh key, you can use (Reference):

ssh -T git@github.com
Amir Pourmand
  • 519
  • 6
  • 17
6

Based on the link.

In the case of the Iran SSL ban, it is possible to run a proxy on the arbitrary free port on your localhost and then reconfigure the git proxy setting. For example, I use the Psiphon to run a proxy by changing the setting shown in the image:

enter image description here

Run the command:

git config --global --add remote.origin.proxy "127.0.0.1:1089"
SRhm
  • 459
  • 1
  • 5
  • 11
5

Try again by using a VPN.

If it doesn't work or you don't have access to any VPN, take your chance by using SSH instead of HTTPS as following steps:

  1. Generate a new ssh key with a passphrase if you don't already have one.

  2. Import the ssh key to your GitHub account.

  3. Clone the repository using SSH.

  4. Now if you're lucky, the pull, push, and other git commands should work.

enter image description here

Ayub
  • 2,345
  • 27
  • 29
5

This worked for me:

git config --global http.sslBackend schannel
Mohammad Asadi
  • 131
  • 2
  • 2
4

generally fatal errors are related to network connection, you can use VPN or proxy on you'r system.

1

In the Visual Studio (2022) go to:

Tools > Options > Source Control > Git Global Settings > Cryptographic Network Provider > Secure Channel

enter image description here

Mehdi
  • 903
  • 3
  • 10
  • 26
0

I was getting an error in that format from many FOSS tools. I solved the problem by temporarily disabling my anti-virus, Kaspersky. (I wouldn't name it publicly but I already told it not to "scan" secure connections so there's no reasonable explanation for this problem.)

Daniel
  • 1
0

use this steps will fix that

first run this gh auth login

then chose GitHub.com then write y and press enter select SSH and continue the steps

good lock

Zoro ا
  • 11
  • 1
0

In my case, the issue was an expired token. Just generate a new token (if this is auth form you're using) and you'll be good to go.

diman82
  • 702
  • 8
  • 11
0

On the github.com website, go to Settings / SSH and GPG Keys -> New SSH Key. Add your public SSH key from your computer. You can find the string for this e.g. under Windows in the path C:\Users\User.ssh or under Linux in the path /home/admin/.ssh in the file id_rsa.pub.

0

In my Case below method works: execute below command under angular root path:

git config user.name "<User Name>"
git config user.email "<Authenticate Email ID>"

after executing above command into my VS code allow me to commit the changes.

Parth M. Dave
  • 853
  • 1
  • 5
  • 16