4

it is really frustrating. Since the demo-end-day I'm not able to get Copilot running again. The login issues seems to be gone, but now I dont get any suggestions. I've found this log:

WARN - #copilot - [ERROR] [default] [2022-09-08T09:15:19.606Z] Request Error: self signed certificate in certificate chain

I'm working in a Windows10-machine and behind a corporate network including proxy, certifcates and stuff.

Copilot version: 1.1.31.1908

IntelliJ IDEA: 2022.2.1

Does anyone has suggestions what I can do?

Pirax
  • 117
  • 1
  • 10

5 Answers5

2

I found a solution for this which works for me. I have blogged about it at https://sidd.io/2023/01/github-copilot-self-signed-cert-issue/

Fix is as follows :

  1. Export the self-signed certificate in discussion
  2. Convert it into .pem format if not already
  3. Export the path of this .pem cert to NODE_EXTRA_CA_CERTS variable
  4. Restart your Intellij and it should work
Siddharth
  • 2,046
  • 5
  • 26
  • 41
1

For people on windows. Following @sedrakpc answer

Be sure to add NODE_EXTRA_CA_CERTS environment variable under "System variables" and not under "User variables"

where to add NODE_EXTRA_CA_CERTS

Juliano Alves
  • 2,006
  • 4
  • 35
  • 37
0

Support for self-signed certificates is a known limitation in our current proxy support. We understand that there's a number of Copilot users that work in environments where this is a necessary requirement, that's why we have support for self-signed certificates on our radar and aim to implement the functionality in the future. We are unable to share a specific timeline for adding self-signed certificate support at this point in time. I understand that this is probably not the answer you were looking for but I hope that it at least provides some extra context around the issue and the plans going forward. Thanks!

https://github.com/community/community/discussions/32285

Pirax
  • 117
  • 1
  • 10
0

I had the same issue (on MacOS) and the debug log of Intellij showed that the codepilot plugin connect error was occuring in Java code.

Since Intellij comes with it's own Java/JDK runtime, which also has it's own certificate store, I added the custom root CA to this file and that made it work for me.

Can't tell the location on Windows, but on a Mac this will be in

/Applications/IntelliJ IDEA CE.app/Contents/jbr/Contents/Home/lib/security/cacerts

So, find that file location, then add the cert with

keytool -import -storepass changeit -keystore PATH_TO_YOUR_INTELLIJ_JRE/lib/security/cacerts -file PATH_TO_YOUR_CUSTOM_ROOTCA.pem
0

Important - this will only work if you are at latest version of Pycharm/Idea and latest version of copilot plugin.

Open github.com on your browser click on lock icon and check if certificate is different(self signed) if yes, export it in .pem format.

On windows you have to convert it from .cer to .pem either using I hate to say online converter like: https://www.sslshopper.com/ssl-converter.html or via command line:

openssl x509 -inform der -in <exported_cert>.cer -out mycert.pem

add NODE_EXTRA_CA_CERTS=<path_to_mycert.pem> environment variable

sedrakpc
  • 508
  • 4
  • 18