Search code examples
rustrust-cargorust-crates

Cargo won't install from crates.io


When trying to install any crate that comes from crates.io, I get this error.

PS D:\ThisGuy\Rust> cargo install adler
    Updating crates.io index
error: failed to download from `https://crates.io/api/v1/crates/adler/1.0.2/download`

Caused by:
  [60] SSL peer certificate or SSH remote key was not OK (schannel: SNI or certificate check failed: SEC_E_WRONG_PRINCIPAL (0x80090322) - The target principal name is incorrect.)

Digging into it I found that the school's DNS server actually blocks any .io website and won't allow me to work with it. Securely uses a DNS server to block disallowed websites. This actually is causing me more pain than you could imagine. Reddit, Unity, Crates, they're all blocked :( Since tech tickets take time to process, I was wondering if there are any alternative ways to work around this? Maybe a cargo command to install from a file instead of from a URL, or perhaps the ability to provide alternative URL's? Any tips would be much appreciated.


Solution

  • Some network proxies used in schools tend to interfere with package registries, git hosting services, and other important sites. I've experienced this with sites that have "suspicious" keywords in the name (hackingwithswift.com, hackerrank.com) as well as a wide range of seemingly completely random domains (even GitHub, unfortunately). This makes it frustrating or impossible to use many developer tools you'd normally take for granted; even cloning a git repo can be impossible to do correctly.

    To fix the problem, you may need to use your own local proxy with a tool like WARP.