`codex login` failed
Resolved 💬 21 comments Opened Jul 2, 2025 by MeowShe Closed Aug 17, 2025
What version of Codex is running?
codex-cli (rust) all versions
Which model were you using?
_No response_
What platform is your computer?
Darwin 24.5.0 arm64 arm
What steps can reproduce the bug?
codex login, then while call the callback URL after completing OpenAI's auth.
What is the expected behavior?
_No response_
What do you see instead?
In terminal:
Starting local login server on http://localhost:1455
If your browser did not open, navigate to this URL to authenticate:
https://auth.openai.com/oauth/authorize?response_type=...
Error logging in: login_with_chatgpt subprocess failed:
In browser:
Error code 500.
Message: Token exchange failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>.
Additional information
- Tried
rm -rf ~/.codex. - Use
OPENAI_API_KEYinstead of paid ChatGPT login works fine. - Using http & https proxy.
21 Comments
I was able to reproduce the issue described. Unable to find any solution at the current time.
Same for me
#1452
@MeowShe
Try the NPM version instead of homebrew, Working for me
#1099
Thank you, @SuperstrongBE. I can confirm that the issue is present in Homebrew version, but not in the NPM one.
<img width="430" alt="Image" src="https://github.com/user-attachments/assets/cca0475c-1434-42f7-b30c-687bcfe1938d" />
@SuperstrongBE @matt-novoselov Yes, the npm package works, but its latest tagged version is
0.1.2505172129, not0.2.0; this seems to be a new issue introduced by the Rust versionYes just realized that 😭
I have same error but on ssl.c:1018 not 1000
Using brew or npm did not solve the issue.
Maybe it's because you're using
0.3.0?I use 0.6.0 currently
Still happening in version 0.8.0 in both brew and npm versions for me (I tried installing it both ways)
Exact same error as the above.
These commands solved it for me:
export SSL_CERT_FILE=$(python3 -m certifi)
export REQUESTS_CA_BUNDLE=$(python3 -m certifi)
Then try "codex login" one more time
@thelonglincoln
Thx a ton, that helped! Still waiting for my "organization" authorization to come in (takes up to 15min, their errormessage says...)
It happens because of outdated python certs, you have to update the list of known CAs.
For me this worked
/Applications/Python\ 3.11/Install\ Certificates.command
Make sure you update with your python path and version.
ChatGPT Summary
✅ Fix for
codex loginfailing with SSL certificate verify error on macOSIf you're on macOS and get this error during
codex login:Token exchange failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>
👉 It’s likely caused by missing CA certificates in your Python environment.
✅ Solution (macOS, Python installed from python.org):
Run this in Terminal:
open /Applications/Python\ 3.11/Install\ Certificates.command
This installs the required root certificates that Python uses for SSL.
After that,
codex loginshould work without SSL errors.So now, we have confirmed that this is an issue caused by SSL certificate verification in Python.
@MeowShe did it resolve your issue?
I also executed
codex loginafter installation ofnpmversion and got this result:<img width="1277" height="570" alt="Image" src="https://github.com/user-attachments/assets/1dced33e-d27f-470c-8793-8e1ca220ee9a" />
Yes, it works.
And I noticed that this is explicitly mentioned as something to do in the Python Installer but I never do it before haha
Thank you, it works for me.
This worked perfectly for me here. Thanks @alpha-adam
Context - Installed via brew - Python 3.11.6
Fixed in 0.22.0. #2044
This actually worked for me as I connect to a remote server in my home lab, and I think this will work for most people. Connect remotely using this and then log into Codex and then go through the process. And when you copy the URL to your web page and authenticate, it'll work perfectly.
ssh -L 1455:localhost:1455 [username]@[remote-lab-server]