Skip to content

Check failed Connection failed: error sending request for url - cc-switch

Quick fix

Toggle or switch the system proxy, then fully restart cc-switch. If needed, upgrade macOS or update to v3.16.3+, preferably 4.x.

Error output
DeepSeek 检查失败 Connection failed: error sending request for url (https://api.deepseek.com/anthropic/v1/messages)
English translation

DeepSeek check failed Connection failed: error sending request for url (https://api.deepseek.com/anthropic/v1/messages)

This error occurs when cc-switch's built-in connectivity check fails to make an outbound HTTPS request. It does not necessarily mean that the provider configuration is incorrect. Multiple issues show that the most common Windows trigger is a mismatch between the system proxy/TUN state and the global reqwest HTTP client cached when cc-switch starts. For example, if a proxy client such as Karing/Clash is enabled or disabled while cc-switch is running, the old connection pool continues using the proxy route from startup. Link tests, balance queries, and self-updates then all report `Connection failed: error sending request for url`, while restarting restores normal operation (#6041). In addition, #3437 found that older versions sent real model requests for link and latency tests and used a network stack different from proxy forwarding, which could stall because of differences such as TLS renegotiation. The maintainer confirmed that v3.16.3 changed this to a lightweight reachability probe and reused the same HTTP client as proxy forwarding, fixing this branch of the problem.

Another group of variants occurs on macOS. Logs in #3968 show rustls-platform-verifier reporting `invalid peer certificate ... not standards compliant: -67825` for every valid certificate on macOS 15, causing all provider checks and in-app updates to fail. Some users reported that upgrading macOS resolved the issue, while others still reproduced it on macOS 13 with cc-switch 3.17~3.20.1. In #3935, certain relay base_url values worked only after running `pkill -9 -f cc-switch` and deleting `~/.codex/.cache`. The maintainer stated that 4.0 reworked connectivity checks and local routing and recommended verifying the issue on the newer release. Overall, this error is more likely a network or client-layer problem than simply an incorrect API Key or model name.

  1. First, test by changing the network state: disable the system proxy or TUN, such as Clash, Karing, or Skyline, then fully quit and restart cc-switch. If that fails, enable the proxy again or switch to another proxy node and retry. Multiple users recovered immediately by enabling, disabling, or switching the proxy.

  2. If you frequently switch the proxy on and off, upgrade to a version with improved proxy routing. On Windows, check for an option such as “Follow system proxy / 跟随系统代理.” After changing it, reapply the settings as prompted or restart cc-switch so the shared HTTP client does not continue using the old proxy.

  3. If Windows reports the error mainly during DeepSeek link or latency tests, upgrade to v3.16.3 or later. This version changed the test to a lightweight reachability probe and reused the same HTTP client as proxy forwarding.

  4. If every provider and even in-app updates fail on macOS, check `~/.cc-switch/logs/cc-switch.log` for the rustls-platform-verifier `-67825` certificate validation error. If present, try upgrading macOS, then update to the latest cc-switch 4.x release and test again.

  5. If a third-party relay intermittently works only after a restart, run `pkill -9 -f cc-switch` to clear remaining processes, then follow #3935 by deleting `~/.codex/.cache` before restarting. Also upgrade to 4.x to verify whether manual cleanup is still required.

Toolcc-switch
Version3.14.1 - 3.20.1(不同子问题修复点不同:v3.16.3 修复测试链接实现;macOS 证书校验问题在升级 macOS 后消失;代理状态缓存问题由后续 4.x/相关 PR 改进)
PlatformsWindowsmacOS
Why can curl or a browser connect while the cc-switch test still fails?
In older versions, the test path and the actual proxy-forwarding path might not use the same HTTP client, and cc-switch caches a global reqwest client. If the proxy/TUN state changes or macOS certificate validation fails, external tools may work while the in-app check still fails.
Does toggling the proxy really help?
Yes. Multiple users recovered after disabling the proxy and restarting cc-switch, enabling and then disabling it, or switching proxies. This usually forces the application onto another network path or rebuilds connections after restart.
What is the most common DeepSeek configuration mistake?
This error is not itself a configuration parsing error and is more often related to the network layer. However, a common configuration in the issues points `ANTHROPIC_BASE_URL` to `https://api.deepseek.com/anthropic` and changes the model name to something like `deepseek-v4-pro`.
Which version fixes this issue?
Not every variant was fixed in the same version. v3.16.3 explicitly fixed the link and latency test implementation. Proxy/TUN state caching and the 4.x redesign cover another set of cases. Users reported that the macOS `-67825` certificate issue disappeared after upgrading macOS.
Is a relay that occasionally requires killing the process the same issue?
The symptom is similar, but the trigger is more likely contaminated runtime state. As a temporary recovery, run `pkill -9 -f cc-switch` and delete `~/.codex/.cache`, then upgrade to 4.x and check whether it still occurs.

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.