[Help Wanted]: How to use self-signed certificates with GitHub Copilot
jerrylcliu opened this issue · comments
Before Reporting
- I have checked FAQ, and there is no solution to my issue
- I have searched the existing issues, and there is no existing issue for my issue
Describe your issue
Using copilot behind a Corporate network, will get this error: self signed certificate in certificate chain.
Behind a normal network, CopilotForXcode works well.
In VSCode, the extension "Mac CA VScode" can solve this;
How to solve this error in CopilotForXcode?
You can try:
- Add
NODE_OPTIONS=--use-openssl-ca
to~/.bashrc
. - Change "Run node with" to
/bin/bash -i -l
, so that the app will read~/.bashrc
for configurations. - Restart the service and host app to restart the language server.
I have tested that with this change, I can MITM the requests to https://api.github.com/copilot_internal/v2/token
with a self-signed certificate.
The GitHub Copilot language server doesn't allow self-signed certificate of copilot-proxy.githubusercontent.com
(for non-enterprise users?), but it works If I use Mac CA VSCode, so I am not sure if it will work.
Nailed it!
- Go to
~/Library/Application Support/com.intii.CopilotForXcode/GitHub Copilot/executable/copilot/dist
- Rename
agent.js
to_agent.js
. - Download the following file, save it to the
dist
folder, and rename it toagent.js
. The file is a javascript version of Mac CA VSCode. - Restart the app to restart the language server.
I will try to include it in the app in the next release.
Nailed it!
- Go to
~/Library/Application Support/com.intii.CopilotForXcode/GitHub Copilot/executable/copilot/dist
- Rename
agent.js
to_agent.js
.- Download the following file, save it to the
dist
folder, and rename it toagent.js
. The file is a javascript version of Mac CA VSCode.- Restart the app to restart the language server.
I will try to include it in the app in the next release.
Thanks for your reply. I try this, it does not work.
The error is still "self signed certificate in certificate chain".
Suggestion cannot show, it works well behind normal network
It should work. Did you restart the service app? Where did you get the error message? I have never seen the message before.
It has now taken effect. I had already restarted the app before my last reply, but it didn't work at that time. Just now, after restarting a few more times and opening Xcode, I found that it has indeed taken effect.
The error message is from console.app - CopilotForXcodeExtensionService, now it doesn't show😂
Released in 0.33.1 beta
Released in 0.33.1