Skip to content

Instantly share code, notes, and snippets.

@AzadGh95
Last active October 26, 2022 11:15
Show Gist options
  • Save AzadGh95/a641dc997ced034c7b62962cee3e4aae to your computer and use it in GitHub Desktop.
Save AzadGh95/a641dc997ced034c7b62962cee3e4aae to your computer and use it in GitHub Desktop.
OpenSSL SSL_connect: Connection reset by peer in connection to api.github.com:443

If you encounter one of the problems in git on your system(ubuntu) : fatal: unable to access ‘xxx‘: gnutls_handshake() failed: Error in the pull function. or OpenSSL SSL_connect: Connection reset by peer in connection to api.github.com:443 you can use these steps and solve your problem:

  1. create a new rsa key in your system in first step you should create a new ssh key: $ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

  2. install gh on your system $ sudo apt update $ sudo apt install gh

  3. login to gh login with gh to cli and select ssh for in authentication steps.

  4. and then upload this file to github by gh: $ gh ssh-key add ~/.ssh/id_rsa.pub

  5. and then to set the correct permissions, use the command: $ sudo chmod 600 ~/.ssh/config

  6. and then clone repository with ssh: $ gh repo clone git@github.com:myCompany/myrepo.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment