Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github authentication extension VSCode

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?


1 Answers

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.

like image 181
VonC Avatar answered Jun 17 '26 23:06

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!