while doing cargo build ,error Caused by: [60] SSL peer certificate or SSH remote key was not OK (SSL certificate problem: self signed certificate in certificate chain)
Problem
I am new to rust and working through the book .The environment is Ubuntu 16.04.5 LTS on oracle virtual box in windows 7
rustc version - rustc 1.33.0 (2aa4c46cf 2019-02-28)
cargo version - cargo 1.33.0 (f099fe94b 2019-02-12)
my cargo.toml is like below
[package]
name = "hello_cargo"
version = "0.1.0"
authors = ["biswa"]
edition = "2018"
[dependencies]
rand = "0.3.14"
when I run cargo build I run into this
biswa@biswa-VirtualBox:~/rust_projects/hello_cargo$ cargo build
error: failed to download from `https://crates.io/api/v1/crates/rand/0.3.23/download`
Caused by:
[60] SSL peer certificate or SSH remote key was not OK (SSL certificate problem: self signed certificate in certificate chain)
I have read here here and here (this one might not be related) that this is due to ssl certificate but I cant seem to fix it .
I have checked strace with cargo fetch but could not figure out which cert.pem its referring to the pastebin of strace ->https://pastebin.com/74Cjcgp4
FYI I can use pip in this box so its probably not a network issue( in my limited understanding)
1. 2. 3.
Possible Solution(s)
Notes
Output of cargo version:
This is probably the same as https://github.com/rust-lang/cargo/issues/13460. As https://github.com/rust-lang/cargo/issues/13460 has more people involved, let's discuss the issue there.