2

I was trying to commit something to github repo using VSCode and I was told that "extension github wants to sign in using github", when I allowed it I was redirected to a page with some link which I could copy in VScode to login.

https://i.ibb.co/KrFHZXs/Screenshot-from-2021-12-30-12-10-09.png

But when I did so it gives me this error:

Sign in failed: FetchError: request to
https://vscode-auth.github.com/token?code=e23e730e3d1c5dc&state=717aca03-28e1-486f-bbb2-57680a149638
failed, reason: self signed certificate in certificate chain

It has become impossible to work with GitHub due to its security restrictions.

Can someone help?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250

2 Answers2

0

If somehow the certificate from GitHub is not trusted by your Ubuntu OS, you can get it with (as suggested here):

mkdir ~/git-certs

openssl s_client -showcerts github.com:443 2>/dev/null </dev/null | \
sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/git-certs/cert.pem

git config --global http.sslCAInfo "${HOME}/git-certs/cert.pem"

Then relaunch your VSCode and try again.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

I had a similar problem, and my final resolution was reinstalling it. However, that didn't solve the problem, as there were remnants left on my windows computer.

In the end, I got the problem removed by completely removing vs-code (or insider) from my computer as suggested here, meaning:

  1. Uninstall by running unins.exe file found in > C: Users\your_user_name\AppData\Local\Programs\Microsoft\ VS Code (or insider)

  2. delete the .vscode or .vscode-insiders folder found in C: Users\your_user_name

  3. Now delete code or code-insider found in >C:\Users\your_user_name\AppData\Roaming

I installed vs-code again and also the github pull requests. I authenticized it using my git account, and things are back to normal. I have had already synced my setting to my account, therefore my previous working setup was back.