-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSL peer certificate or SSH remote key was not OK #1420
Comments
Can you gist a full log of the build as well? |
This is a log of three successive runs. This repeats, looping around to the first package again. |
Closing this because it seems to be related to the openssl installation on my machine. |
I have the same problem on Mac Os X. |
A few things you can try:
|
I have no problem visiting the https://crates.io with safari, the lock appears and everything is correct. pip search returns a warning :
|
Try renaming |
Sorry I mean /etc/ssl/ doesn't even exist. |
Firstly, the pip error might mean your python is out of date but it could also be related to a general SSL error. After you installed openssl did you do |
Even after brew link --force openssl it shows the same error. |
I'm having the same issue on OSX Yosemite 10.10.3. Doing a
|
So that some future person (maybe me?) Googling this issue knows how I fixed it, I had a rogue certificate bundle in |
It seems I've got a certificate problem :
But I have no idea how to resolve it. |
I discovered that an RVM upgrade put that |
Thanks it was that, I renamed cert.pem. |
I'm still having this issue. |
This fixed the error and am now able to sudo mv /etc/openssl /etc/openssl-bak When I ran
|
I seem to be having this issue on OSX 10.10.4 with openssl installed via brew and without an /etc/openssl/cert.pem certificate. |
@djpalmer88 I have /etc/openssl/cert.pem and even |
I'm actually seeing this on 10.10.4 (14E36b). curl/git and such all working fine. cargo (1.0 and nightly) refuse to download anything with the above mentioned error. This is regardless of removing /etc/openssl, updating certs there... etc. Turned out (thanks to dtruss ;) that in my case the following locations had a certs.pem with invalid certs: /etc/openssl/certs.pem Removing all of them did the trick. @andoriyu try that location. If it still does not work, run cargo like this:
And look where it reads the certs.pem from. |
Thanks, it worked. |
Have this issue too, still have no clue how to solve it. |
I have the same problem on mac os10.10.5 (14F27) ➜ racer git:(master) cargo build --release --verbose
Downloading syntex_syntax v0.13.0
Unable to get packages from source
Caused by:
Failed to download package `syntex_syntax v0.13.0` from https://crates.io/api/v1/crates/syntex_syntax/0.13.0/download
Caused by:
SSL peer certificate or SSH remote key was not OK I can't get any crate on cargo. |
@paomian what version of Cargo are you running? You may want to try using the latest Cargo builds as well and see if the problem is fixed. |
@alexcrichton I tried the latest version of Cargo, the issue still exist. The only solution is rename |
I was having this issue again on Example output after cloning https://github.com/hyperium/hyper : ~/github/RUST/hyper master
❯ cargo fetch --verbose
Updating registry `https://github.com/rust-lang/crates.io-index`
Downloading gcc v0.3.16
unable to get packages from source
Caused by:
Failed to download package `gcc v0.3.16` from https://crates.io/api/v1/crates/gcc/0.3.16/download
Caused by:
Peer certificate cannot be authenticated with given CA certificates
[1] 23354 exit 101 cargo fetch --verbose Since SSL certificate errors were being thrown from the https://crates.io domain, I tried importing the crates.io X.509 Certificate (PEM) with
After doing the above, I haven't had a single error reported with cargo e.g. The initial command repeated after importing crates.io.pem and trusting for SSL : ~/github/RUST/hyper master*
❯ cargo fetch --verbose
Updating registry `https://github.com/rust-lang/crates.io-index`
Downloading openssl-sys v0.6.5
Downloading traitobject v0.0.1
Downloading gcc v0.3.16
Downloading language-tags v0.0.7
Downloading regex v0.1.41
Downloading num v0.1.27
Downloading typeable v0.1.2
Downloading openssl v0.6.5
Downloading rand v0.3.11
Downloading advapi32-sys v0.1.2
Downloading libc v0.1.10
Downloading time v0.1.32
Downloading env_logger v0.3.1
Downloading winapi-build v0.1.1
Downloading aho-corasick v0.3.2
Downloading regex-syntax v0.2.2
Downloading pnacl-build-helper v1.4.10
Downloading pkg-config v0.3.5
Downloading libressl-pnacl-sys v2.1.6
Downloading log v0.3.2
Downloading solicit v0.4.4
Downloading cookie v0.1.21
Downloading httparse v0.1.6
Downloading lazy_static v0.1.14
Downloading winapi v0.2.4
Downloading tempdir v0.3.4
Downloading hpack v0.2.0
Downloading unicase v1.0.0
Downloading bitflags v0.3.2
Downloading num_cpus v0.2.6
Downloading kernel32-sys v0.1.4
Downloading rustc-serialize v0.3.16
Downloading mime v0.1.0
Downloading url v0.2.37
Downloading serde v0.6.0
Downloading matches v0.1.2
Downloading memchr v0.1.6
~/github/RUST/hyper master* 13s
❯ |
@alexcrichton I fix it when i mv |
I also faced same problem while installing hyper. cargo --version Is there some problem on it? |
I use cargo 0.6.0-nightly (ec85eef 2015-10-10), still have this issue. Error info:
Test with curl:
|
Also using cargo 0.6.0-nightly (ec85eef 2015-10-10), I faced the same issue on all the crates I tried to install. Can confirm that |
I have openssl installed through homebrew, but even after uninstalling it (and unlinking it) and having the |
@rgardner hm I'm curious, but do you know how |
@rgardner @alexcrichton |
Hm how'd you install rvm? I just installed it and |
Hmm, Finder tells me that my |
It seems is this case: rvm/rvm#2875 (comment), probably also this: rvm/rvm#3330 I deleted |
@towry is it okay after deleting it? Is it okay using rvm? |
I'm on OSX El Capitan, removing |
@rodrei do you know what introduced that file in the first place? |
@alexcrichton Sorry, I don't. It was the first time I was attempting to use Cargo to install dependencies. |
@alexcrichton Some more info: I was trying to install some gems using the |
Ran into this same issue today. Removing the cert.pem worked for me, too. |
This should help continue to mitigate rust-lang#1420 further
This should help continue to mitigate #1420 further
Same thing happened to me on Arch Linux. The directory /etc/openssl does not exist. Renaming /etc/ssl/cert.pem does not help.
|
@alexcrichton Is this issue resolved? I am getting this error with the latest stable release.
|
@rohitjoshi sounds like #1180 |
Yes, it is duplicate.thanks. |
Hmm, now I'm getting this out of nowhere
I ran $ openssl verify -verbose /etc/ssl/certs/ca-certificates.crt
/etc/ssl/certs/ca-certificates.crt: OK I ran the following without it helping $ sudo mv /etc/ssl/certs /etc/ssl/certs.bak |
I'm running WSL. For me, the problem was that Windows correctly updated for daylight saving time but not the WSL instance I was running in. Restarting WSL got it working, |
Running
cargo build --verbose
produces an "SSL peer certificate or SSH remote key was not OK" when attempting to download a package from crates.io. Packages from github are pulled without any problems. My system is OSX Yosemite 10.10.2.Interestingly, when attempting to download the package manually from https://crates.io/api/v1/crates/package/x.x.x/download with curl, nothing is downloaded, but with wget the download succeeds.
I can also confirm that it's not a network issue as another computer on my network(running windows) can download the packages without any issues.
The text was updated successfully, but these errors were encountered: