cargo: failed to get from registry (spurious network error) Rust Origin: Application & API OSI layer 7 · Application Last updated 5 Nov 2026

Cargo: warning: spurious network error (2 tries remaining): [35] SSL connect error / error: failed to download from `https://index.crates.io/...`

Cargo couldn't reach crates.io (network, proxy, TLS or DNS issues).

Exact message you may see warning: spurious network error (2 tries remaining): [35] SSL connect errorerror: failed to get `serde` as a dependency of packageCaused by: failed to query replaced source registry `crates-io`error: failed to download from `https://static.crates.io/crates/`Caused by: [6] Could not resolve host: index.crates.io
Seen on: Rust Linux

Meaning

Check connectivity (curl -I https://index.crates.io/config.json), proxies (HTTPS_PROXY, [http] proxy in ~/.cargo/config.toml), corporate TLS (CARGO_HTTP_CAINFO), DNS and retries (CARGO_NET_RETRY). Use the sparse protocol (default since 1.70). Offline mode: cargo build --offline with vendored crates.

Common causes

  • No internet/DNS
  • Corporate proxy/TLS interception
  • Rate limiting or registry outage
  • Git-based index timeouts (old cargo)
  • Firewall blocking crates.io/static.crates.io

⚡ Quick fix

  1. curl -I https://index.crates.io/config.json to test
  2. Set proxy/CA: CARGO_HTTP_CAINFO=/path/ca.pem
  3. CARGO_NET_RETRY=10, cargo vendor for offline builds

Detailed fix by platform

Linux

  1. CARGO_NET_RETRY=10 CARGO_HTTP_DEBUG=true cargo fetch

How to diagnose

  1. Network — crates.io reachable?
  2. Proxy/CA — Configured?
  3. Retry — Raised?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

Blocking waiting for file lock on package cache / build directory — Cargo: Blocking waiting for file lock on package cache / on build directory (Rust)Blocking waiting for …Cannot start a runtime from within a runtime (Tokio) — Rust: thread 'main' panicked: Cannot start a runtime from within a runtime — a function like `block_on` tried to block a thread that drives async tasks (Rust)Cannot start a runtim…cargo: failed to select a version for the requirement — Cargo: error: failed to select a version for the requirement `serde = "^2.0"` — candidate versions found which didn't match: 1.0.197 (Rust)cargo: failed to sele…client_loop: send disconnect: Broken pipe — client_loop: send disconnect: Broken pipe (SSH session drops when idle) (Linux)client_loop: send dis…curl: (60) SSL certificate problem — curl: (60) SSL certificate problem: unable to get local issuer certificate (SSL / TLS)curl: (60) SSL certif…E0004: non-exhaustive patterns — Rust: error[E0004]: non-exhaustive patterns: `None` not covered (Rust)E0004: non-exhaustive…E0015: cannot call non-const function in constants — Rust: error[E0015]: cannot call non-const function `String::from` in constants (Rust)E0015: cannot call no…E0038: the trait cannot be made into an object — Rust: error[E0038]: the trait `Shape` cannot be made into an object (not dyn compatible) (Rust)E0038: the trait cann…cargo: fa…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.