[BUG] Proxy mode error: Hostname/IP does not match certificate's altnames

Resolved 💬 4 comments Opened May 8, 2025 by Peilun-Li Closed Jan 3, 2026

Environment

  • Platform (select one):
  • [ ] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [x] Other: LiteLLM proxy (OpenAI chat completion schema)
  • Claude CLI version: 0.2.105
  • Operating System: macOS 14.7.5
  • Terminal: iTerm2

Bug Description

Error when trying to connect claude to our internal litellm proxy

Unable to connect to Anthropic services

Failed to connect to api.anthropic.com: Hostname/IP does not match certificate's altnames: Host: api.anthropic.com. is not in the
 cert's altnames: DNS:internal.litellm.proxy.net, DNS: *.internal.litellm.proxy.net

Steps to Reproduce

Following this Connect through a proxy doc to start claude

ANTHROPIC_AUTH_TOKEN="internal_proxy_token" HTTPS_PROXY="https://our.internal.litellm.proxy.net/openai/v1/"  claude

Expected Behavior

Claude should be able to use our internal proxy

Actual Behavior

Got the error mentioned above. It feels claude still attempts to connect to api.anthropic.com somehow even instructed with a proxy overwrite.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗