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,129,465
  • 480
  • 4,036
  • 4,755

1 Answers1

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,129,465
  • 480
  • 4,036
  • 4,755