Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save daubac402/a0c1e5eab80b2d6754c5ed5a59c0fd7d to your computer and use it in GitHub Desktop.
Save daubac402/a0c1e5eab80b2d6754c5ed5a59c0fd7d to your computer and use it in GitHub Desktop.
Make Github copilot works with self-certificate in IntelliJ (Windows)

Make Github copilot works with self-certificate in IntelliJ (Windows)

Problem

You can't login to Github to use Github Colpilot in your IntelliJ due to you are using self-certificate.
And you got this error message

Sign in failed. Reason: Request signInInitiate failed with message: self signed certificate in certificate chain, request id: 3, error code: -32603

Solution

Assume that you added your self CA cert into your OS "Trusted Root Certification Authorities".

  1. Export the self-signed certificate in your OS.
    1. Start > search "Manage user certificates" > "Trusted Root Certification Authorities" > "Certificates" > Right click on your self-signed certificate > "All Tasks" > "Export..."
    2. Next > Choose "DER encoded binary X.509 (.CER)" > Next > Choose a path to save the certificate > Next > Finish
  2. Convert the certificate to .pem format.
    1. Open a terminal > openssl x509 -inform der -in <exported_cert>.cer -out mycert.pem
  3. Export the NODE_EXTRA_CA_CERTS environment variable.
    1. Start > search "Edit environment variables for your account" > "New..." > Variable name: NODE_EXTRA_CA_CERTS, Variable value: <path_to_mycert.pem>
  4. Re-start your Intellij and this should now work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment