I can't seem to be able to install, build or update any external crates with Cargo. I have already reinstalled the entire toolchain with rustup and I have tried with both stable-x86_64-unknown-linux-gnu (1.51.0) and nightly-x86_64-unknown-linux-gnu (1.53.0).
When trying cargo build in my project directory, I get the following:
Updating crates,io index
error: failed to gettaras a dependency of packagecodecom v0.1.0 (/home/mak/Projects/rust/codecom)Caused by:
failed to load source for dependencytarCaused by:
Unable to update registry crates,io-indexCaused by:
failed to fetch crates,io-indexCaused by:
network failure seems to have happened
if a proxy or similar is necessarynet.git-fetch-with-climay help here
https:// Configuration - The Cargo BookCaused by:
SSL error: received early EOF; class=Ssl (16); code=Eof (-20)
When I follow on the suggestion and do
export CARGO_NET_GIT_FETCH_WITH_CLI=true
I then get the following instead:
Updating crates,io index
error: failed to gettaras a dependency of packagecodecom v0.1.0 (/home/mak/Projects/rust/codecom)Caused by:
failed to load source for dependencytarCaused by:
Unable to update registry crates,io-indexCaused by:
failed to fetch crates,io-indexCaused by:
process didn't exit successfully:git fetch --force --update-head-ok 'github.com/rust-lang/crates,io-index' 'refs/heads/master:refs/remotes/origin/master' 'HEAD:refs/remotes/origin/HEAD'(exit code: 128)
--- stderr
error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with unexpected length was received.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
As stated, I have reinstalled the entire Rust toolchain via rustup and I have also reinstalled git and checked that my certificates are up-to-date. I and using VS Code with the Rust extension however these results are the same regardless of terminal session. My distro is an updated Ubuntu 16.04 LTS.
I hope that there is something obvious I am missing as I can't seem to find anything about this. As it stands, I am unable to even update the crates index for my cargo let alone use external crates.
If you can help, thank you.