Failed to list available models due to duplicate CA certificates from combined system and bundled certs
Describe the bug
whatever i ask, always show this error
Affected version
0.0.373 Commit: 1f9ed04
Steps to reproduce the behavior
No response
Expected behavior
No response
Additional context
No response
Perhaps a corner case, but in my case there was a MTU limit hit as well.
To fix it:
sudo ip link set dev eth0 mtu 1300
And then test:
openssl s_client -connect api.business.githubcopilot.com:443
If you still don't get the SSL (notice 104 error code):
Connecting to 140.82.113.22
CONNECTED(00000003)
write:errno=104
---
no peer certificate available
---
No client certificate CA names sent
Negotiated TLS1.3 group: <NULL>
---
SSL handshake has read 0 bytes and written 1572 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Protocol: TLSv1.3
This TLS version forbids renegotiation.
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---
Reduce MTU until package fits
@andyfeller I don't wanna hijack this conversation. But as you're having discussions with the team, I just wanted to bring this issue to your attention. I haven't confirmed anything yet, but I have a suspicion this issue also applies to VS Code as well.
Thanks for raising that issue to my attention, @fishcharlie 🙇 I've been digging into what VS Code experiences do around this, so it is serendipitous timing. 😅
What problem are we trying to solve in Copilot CLI?
The certificate changes in 0.0.370 were meant to let copilot work with proxies, requiring system certificates not in the Mozilla CA bundle that Node uses by default. The intent was to avoid users needing to deal with Node flags and env var knowledge.
What does VS Code and VS Code Copilot experiences do?
As you noticed, VS Code provides 2 options that users can control where CA certificates are sourced from:
'http.systemCertificates': {
type: 'boolean',
default: true,
markdownDescription: localize('systemCertificates', "Controls whether CA certificates should be loaded from the OS. On Windows and macOS, a reload of the window is required after turning this off. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.", '`#http.useLocalProxyConfiguration#`'),
restricted: true
},
'http.systemCertificatesNode': {
type: 'boolean',
tags: ['experimental'],
default: systemCertificatesNodeDefault,
markdownDescription: localize('systemCertificatesNode', "Controls whether system certificates should be loaded using Node.js built-in support. Reload the window after changing this setting. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.", '`#http.useLocalProxyConfiguration#`'),
restricted: true,
experiment: {
mode: 'auto'
}
},
These come into play in a few related projects:
How do we address this?
Removing those 2 certificates in my login keychain, fixed this issue.
Don't merge
systemcertificates withbundled. Either:
- Use only
bundledcertificates, or- Deduplicate by Subject before merging, preferring self-signed roots
Maybe just using bundled is the right choice, as the users with more advanced needs can use standard node envs.
@paolomainardi : My theory why these 2 self-signed certificates caused problems is because they broke the CA chain. I don't know if preferring self-signed certificates would have been the answer here since it took removing them to allow connections to be made.
I haven't confirmed anything yet, but I have a suspicion this issue also applies to VS Code as well. It'd be amazing to get a fix across everything.
@fishcharlie: Ideally I would like consistent behavior, but I also want to point out that GitHub Copilot CLI has a broader use case in automation than VS Code.
The microsoft/vscode-proxy-agent library provides a set of common tools for the different VS Code products. Looking at how it's used in microsoft/vscode and microsoft/vscode-copilot-chat, I'm not sure it does any deduplication or other filtering before overriding the TLS certificates. 🤔
im having the same issue which means I am not able to use copilot-cli. is there any workaround for this? I do not have the same login certificates that paolomainardi mentions
I also get the same error when I use @cli in the chat window of vscode.
For me Homebrew update broke Node TLS trust. Copilot CLI failed with “unable to get issuer certificate”. Setting CA bundle fixed it:
export NODE_EXTRA_CA_CERTS="/opt/homebrew/etc/openssl@3/cert.pem"
After that, Copilot CLI works again.
Reinstalling ca-certificates/openssl@3 also helps.
NODE_EXTRA_CA_CERTS works well, thank you!
NODE_EXTRA_CA_CERTS="/opt/homebrew/etc/openssl@3/cert.pem" copilot
I tried the NODE_EXTRA_CA_CERTS and still doesn't work...
This appears to be resolved as of GitHub Copilot CLI v1.0.103. Please update to that release or a newer stable version. We're closing this as completed. If it still happens, please comment with your version and reproduction steps.