Failed to login on company proxy/vpn. reason: self-signed certificate in certificate chain
What happened?
Here is the error when I was on company proxy/vpn. Failed to login. Message: request to https://oauth2.googleapis.com/token failed, reason: self-signed │ │ certificate in certificate chain
I saw this https://discuss.ai.google.dev/t/gemini-api-connection-ssl-error/335/9
How to set transport=‘rest’ in gemini CLI?
What did you expect to happen?
expect to be able to login
Client information
$ gemini /about
# paste output here
Login information
No response
Anything else we need to know?
No response
gemini-cli cannot use gemini-2.5-pro, and automatically switches to gemini-2.5-flash after startup. It cannot be used at all
This issue is caused by the corporate VPN inserting a self-signed certificate that Node.js does not trust by default, and is not an issue with Gemini CLI. Here's how to fix it:
1. Register your company’s certificate with Node.js (Recommended) Set the following environment variable in PowerShell (adjust the path to your certificate):
$env:NODE_EXTRA_CA_CERTS="C:\path\to\corp-cert.crt"
or,
2. Disable SSL certificate verification in Node.js (Not recommended) This bypasses certificate validation entirely, which can expose you to security risks:
npm config set strict-ssl false -g
Hope this helps!
Found possible duplicate issues:
- #4581: (0.9048164543618901)
- #2350: (0.904660701751709)