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.

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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With