Logging in with ChatGPT failing
Resolved 💬 11 comments Opened Aug 7, 2025 by ProCreations-Official Closed Aug 7, 2025
💡 Likely answer: A maintainer (bolinfest, collaborator)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
codex-cli 0.16.0
Which model were you using?
_No response_
What platform is your computer?
Darwin 25.0.0 arm64 arm
What steps can reproduce the bug?
Install Codex Cli, login with chatgpt
What is the expected behavior?
Logs in and authenticates properly
What do you see instead?
Error response
Error code: 500
Message: Token exchange failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1028)>.
Error code explanation: 500 - Server got itself in trouble.
Additional information
_No response_
11 Comments
Are you on a headless machine?
If so, please see https://github.com/openai/codex/issues/1243#issuecomment-3165318852
Not on headless, on MacBook with everything setup (display, keyboard, trackpad)
Hmm, what is
python3 -V?(Also just confirming that you aren't trying to use this in a Docker container, despite being on a Mac.)
same problem!
Error Message in Codex: Error logging in: login_with_chatgpt subprocess failed:
i was getting error 500 on macOS like the original post, this following steps fixed the issue for me:
python3 -m ensurepip --upgrade
python3 -m pip install --upgrade certifi
export SSL_CERT_FILE="$(python3 -c 'import certifi; print(certifi.where())')"
codex login
Just sharing what worked on my machine, run at your own discretion.
python3 -m ensurepip --upgrade
Looking in links: /var/folders/wg/90ttqb114y1g4kqsrbt0fy8m0000gn/T/tmploamjnvc
Requirement already satisfied: pip in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (24.3.1)
❯ python3 -m pip install --upgrade certifi
Collecting certifi
Downloading certifi-2025.8.3-py3-none-any.whl.metadata (2.4 kB)
Downloading certifi-2025.8.3-py3-none-any.whl (161 kB)
Installing collected packages: certifi
Successfully installed certifi-2025.8.3
[notice] A new release of pip is available: 24.3.1 -> 25.2
[notice] To update, run: python3 -m pip install --upgrade pip
❯ export SSL_CERT_FILE="$(python3 -c 'import certifi; print(certifi.where())')"
❯ codex login
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? XXX
Successfully logged in
Worked for me - Thanxs! For the fast Support!
Worked, thank you!
After logging in, I get #1960
Worked for me. MacMini Sequoia 15.6
For reference, the following method also worked:
https://stackoverflow.com/a/77491061