[BUG] Drop HTTP connection on "access denied" API errors
Status Open
Reported on v2.1.287
Maintainer reply None cached
Activity 0 comments · opened Oct 6, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When getting Access Denied from the API server e.g. Vertex AI, it could be due to an IP restriction which can be corrected with a VPN connection.
Even once a VPN connection is established, Claude is wedged in a state where it keeps getting "Access Denied" since it keeps reusing the pre-VPN socket that connects over the non-VPN interface.
What Should Happen?
Drop HTTP keep-alive socket on auth errors.
Error Messages/Logs
Steps to Reproduce
- Set up an API server with IP allowlist.
- Start Claude while the "VPN" interface that uses allowlisted IP is down.
- Observe Claude getting an auth error.
- Bring up the "VPN" interface.
- Observe Claude is still getting an auth error.
- Restart Claude.
- Observe Claude manages to auth.
Claude Model
_No response_
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.287
Platform
Google Vertex AI
Operating System
Ubuntu/Debian Linux
Terminal/Shell
iTerm2
Additional Information
_No response_