Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid SSL certificate when building a crate with cargo

While trying an example from the tutorial (guessing game) after defining a dependency (rand="0.3.0") I got this:

$ cargo build --verbose
    Updating registry `https://github.com/rust-lang/crates.io-index`
Unable to update registry https://github.com/rust-lang/crates.io-index

Caused by:
  failed to fetch `https://github.com/rust-lang/crates.io-index`

Caused by:
  [16] The SSL certificate is invalid

Added this to cargo registry git repo, but without success:

[http]
    sslVerify = false

Where to dig?

like image 329
Tuxdevo Avatar asked May 21 '15 08:05

Tuxdevo


People also ask

What happens if SSL certificate is invalid?

An SSL certificate error occurs when the browser cannot verify the SSL certificates returned by the server. When the error happens, the browser blocks the website and warns the user that the website cannot be trusted as shown below. These warnings will negatively impact the user's trust in your website.


1 Answers

I ran into the same problem today and found that my $HOME/.gitconfig had this:

[url "[email protected]:"]
    insteadOf = https://github.com/

I had added this to make go get to work over SSH for private repos. Commenting this out fixed the error.

like image 158
Indradhanush Gupta Avatar answered Oct 03 '22 15:10

Indradhanush Gupta