Invalid SSL certificate when creating a cargo box

When I tried an example from a tutorial (guessing a game) after determining a dependency ( rand="0.3.0" ), I got the following:

 $ 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 the git repo product registry, but to no avail:

 [http] sslVerify = false 

Where to dig?

+6
source share
2 answers

As stated in the comments, it could be someone between you and Github modifying your message ( MITM ) or incorrect configuration on your system (for example, missing certificates). (The problem is unlikely on the side of Github.)

First debug using simple git: git clone https://github.com/rust-lang/crates.io-index.git

To get information about what exactly it was not possible to use openssl s_client -debug -showcerts -connect github.com:443 , and if it does not exit by itself (because the connection works), press CTRL-C to exit. The output contains information about which certificates were submitted by the remote and how it was verified or failed to be verified.

If someone changes your message, please post the output of this and traceroute github.com or something similar so that others can avoid this provider.

0
source

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

 [url " git@github.com :"] insteadOf = https://github.com/ 

I added this so that go get works on SSH for private repositories. Commenting on this, the bug is fixed.

0
source

Source: https://habr.com/ru/post/987640/


All Articles