Skip to content

error: could not download file from ... #1328

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

Closed
GildedHonour opened this issue Jan 4, 2018 · 51 comments
Closed

error: could not download file from ... #1328

GildedHonour opened this issue Jan 4, 2018 · 51 comments

Comments

@GildedHonour
Copy link

Arch linux
Internet connection has no problem

$ rustup update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/home/alex/.rustup/tmp/n6b91922kkyrvmlh_file'
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256' to '/home/alex/.rustup/tmp/mb54blu9ah_jdzen_file'

   stable-x86_64-unknown-linux-gnu update failed - rustc 1.22.1 (05e2e1c41 2017-11-22)
  nightly-x86_64-unknown-linux-gnu update failed - rustc 1.24.0-nightly (687d3d15b 2018-01-02)
@GildedHonour
Copy link
Author

GildedHonour commented Jan 4, 2018


$ curl https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/home/alex/.rustup/tmp/n6b91922kkyrvmlh_file
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>dist/channel-rust-stable.toml.sha256to/home/alex/.rustup/tmp/n6b91922kkyrvmlh_file</Key><RequestId>84E2EE4A96B2FB85</RequestId><HostId>s5mhaDJJ7MX1Luf096u7qCvAHYqB0TlBpJLERe0BxNGY+glWMuV45Vev4QYEGFVcbnlS/EdafWg=</HostId></Error>


$ curl https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256' to '/home/alex/.rustup/tmp/mb54blu9ah_jdzen_file
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>dist/channel-rust-nightly.toml.sha256to/home/alex/.rustup/tmp/mb54blu9ah_jdzen_file</Key><RequestId>D3A7574FEF0E8854</RequestId><HostId>9rg8TebkQ3mPrVE265Hy1rWE0cm4Vgw6iG/p9PhqXenxwJh2utaRivn8FEz6iniVpE+yAMoFIo8=</HostId></Error>

@sgy1993
Copy link

sgy1993 commented Apr 4, 2018

Have this problem solved? I meet the same issue........

@jneumann
Copy link

Any word on this? I'm running into the same issue and I can't figure out what's wrong.

@lambda
Copy link

lambda commented Apr 27, 2018

@GildedHonour When you copied and pasted that URL into curl, you copied some extra text as well, which caused your error.

When I run curl https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256 I get what looks like a valid sha256 file:

$ curl https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256
10da11872e920f56826d8a6ba63712a24f4d44d3f31d800c311d9ae9207cf28e  channel-rust-stable.toml

In #1400, @jneumann writes "When I ran the command with --verbose, the file it was trying to download was the *.toml.sha256 file, which I can manually download via curl without issue."

For me, both rustup and curl work, so we might need some more information from those for whom it doesn't work to debug the issue.

To debug such a problem, it would be useful for someone seeing the problem to try doing a packet capture during the rustup command and the curl command to see how the HTTP request and reply differ. If you are on a linux system and have tcpdump installed, you should be able to run tcpdump -s0 -w rustup-issue-1328.pcap -i <your-ethernet-or-wifi-device> tcp port 443 or udp port 53, and while that is running try the download with both curl and rustup. It will be helpful if you don't have anything else running which might be doing HTTPS or DNS requsts, so you only capture traffic generated by these two commands.

That resulting rustup-issue-1328.pcap file can be viewed in Wireshark or posted on CloudShark to see what is going on differently between rustup and curl when accessing this file.

@lambda
Copy link

lambda commented Apr 27, 2018

A few other things that I might use to debug the issue: run strace on rustup and curl to see what files they are each opening; it could be possible that they are using different certificate stores, or different proxy settings, or the like.

@jneumann
Copy link

@lambda Thanks for the tips. I narrowed it down to an issue with my ISP's DNS. Unfortunately, I don't know enough about how the Internet works to narrow it down further.

@Diggsey
Copy link
Contributor

Diggsey commented May 30, 2018

@GildedHonour @sgy1993 can you confirm whether changing your DNS fixes the problem? (eg. try google's DNS on 8.8.8.8)

@godwinchang
Copy link

When install 1.28 on macos, this problem occurs.

rustup --verbose default stable
verbose: read metadata version: '12'
verbose: looking for installed toolchain 'stable-x86_64-apple-darwin'
verbose: installing toolchain 'stable-x86_64-apple-darwin'
verbose: toolchain directory: '/Users/chmin/.rustup/toolchains/stable-x86_64-apple-darwin'
info: syncing channel updates for 'stable-x86_64-apple-darwin'
verbose: creating temp file: /Users/cmin/.rustup/tmp/48wps64tthrowyfd_file
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256'
verbose: downloading with curl
verbose: deleted temp file: /Users/cmin/.rustup/tmp/48wps64tthrowyfd_file
verbose: removing toolchain directory: '/Users/cmin/.rustup/toolchains/stable-x86_64-apple-darwin'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/Users/cmin/.rustup/tmp/48wps64tthrowyfd_file'
info: caused by: error during download
info: caused by: [28] Timeout was reached (Operation timed out after 30004 milliseconds with 0 out of 0 bytes received)

@ghost
Copy link

ghost commented Oct 30, 2018

windows10
Internet connection has no problem


Welcome to Rust!

This will download and install the official compiler for the Rust programming
language, and its package manager, Cargo.

It will add the cargo, rustc, rustup and other commands to Cargo's bin
directory, located at:

  C:\Users\xxxx\.cargo\bin

This path will then be added to your PATH environment variable by modifying the
HKEY_CURRENT_USER/Environment/PATH registry key.

You can uninstall at any time with rustup self uninstall and these changes will
be reverted.

Current installation options:

   default host triple: x86_64-pc-windows-msvc
     default toolchain: stable
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>1

info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to 'C:\Users\Enyala\.rustup\tmp\3yj89lchh3vfhemb_file'
info: caused by: error during download
info: caused by: [28] Timeout was reached
Press the Enter key to continue.

that's my first install the Rust program language and I can assess to the office website.but this problem still exist.

@brucejee
Copy link

brucejee commented Dec 2, 2018

I meet the same issue.

Current installation options:

   default host triple: x86_64-pc-windows-msvc
     default toolchain: stable
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>1

info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to 'C:\Users\DH\.rustup\tmp\f7xa5i_g2dy72jtm_file'
info: caused by: error during download
info: caused by: [35] SSL connect error

Press the Enter key to continue.

@jadestrong
Copy link

me too

@xwvon
Copy link

xwvon commented Jan 3, 2019

try again...

@MarkJr94
Copy link

Having this exact problem on a fresh Ubuntu 18.04 install no it's not my router or DNS, other machines on the same network and DNS work fine

@dalance
Copy link

dalance commented Jun 5, 2019

I have the same issue on https://build.snapcraft.io.
There are 5 architecture environments (armhf/arm64/ppc64el/i386/amd64).
This issue occurred on armhf only.

info: syncing channel updates for 'stable-arm-unknown-linux-gnueabihf'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/root/.cargo/tmp/299821akh41mwhqi_file'
info: caused by: failed to make network request
info: caused by: https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256: timed out

Full build log is below:
https://build.snapcraft.io/user/dalance/procs/577559

@kinnison
Copy link
Contributor

kinnison commented Jun 5, 2019

@dalance Is there a non-standard network setup in the snapcraft build environment? Rustup defaults to making direct connections unless there's an appropriate proxy configured in the environment. If snapcraft relies on an altered curl library or somesuch then rustup won't be able to work there.

@dalance
Copy link

dalance commented Jun 6, 2019

@kinnison Thank you for your suggestion. Snapcraft environment seems to use proxy.
I ran some test script on the environment. rustup with curl-backend is OK, and rustup with reqwest-backend is NG.

$ curl https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256
e6118276ddab3e00a967e11583685e3205564e31e4007968056ffd0878db19c0  channel-rust-stable.toml
$ echo $http_proxy
http://10.10.10.1:8222/
$ echo $https_proxy
http://10.10.10.1:8222/
$ ~/.cargo/bin/rustup install stable
info: syncing channel updates for 'stable-arm-unknown-linux-gnueabihf'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/root/.cargo/tmp/299821akh41mwhqi_file'
info: caused by: failed to make network request
info: caused by: https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256: timed out
$ RUSTUP_USE_CURL=1 ~/.cargo/bin/rustup install stable
info: syncing channel updates for 'stable-arm-unknown-linux-gnueabihf'
info: latest update on 2019-05-23, rust version 1.35.0 (3c235d560 2019-05-20)
info: downloading component 'rustc'
info: downloading component 'rust-std'
info: downloading component 'cargo'
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'

@kinnison
Copy link
Contributor

kinnison commented Jun 6, 2019

Okay, that's interesting. Does cURL still manage to download if you unset the proxy environment variables? rustup should honour those environment variables using the reqwest backend, so perhaps something else is in play?

@dalance
Copy link

dalance commented Jun 6, 2019

If unset, cURL can't download.

$ unset http_proxy
$ unset https_proxy
$ curl https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256
curl: (6) Could not resolve host: static.rust-lang.org

@kinnison
Copy link
Contributor

kinnison commented Jun 6, 2019

@dalance Fascinating, our reqwest backend really ought to be working with all that. I wonder what's going on. I will be at Snapcraft Summit next week in Montréal, so if you could possibly provide details of how to reproduce that environment I will see if I can debug it while with Snappy people.

@dalance
Copy link

dalance commented Jun 7, 2019

@kinnison My snapcraft.yaml to reproduce is below.

name: procs
version: &version v0.8.5
summary: A modern replacement for ps written in Rust
description: |
  procs is a tool to display process information.
base: core18
license: MIT

confinement: strict

architectures:
# - build-on: amd64
# - build-on: i386
# - build-on: ppc64el
# - build-on: arm64
  - build-on: armhf

apps:
  procs:
    command: procs

parts:
  procs:
    source: https://github.com/dalance/procs.git
#   source-tag: *version
    plugin: make
    stage-packages:
      - libc6
      - libgcc1
      - libstdc++6
      - zlib1g
    build-packages:
      - curl
    override-build: |
      /build/procs/parts/procs/src/rustup.sh -y --default-toolchain none -v
      curl https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256
      echo $http_proxy
      echo $https_proxy
      RUSTUP_USE_CURL=1 ~/.cargo/bin/rustup install stable

I tried to reproduce qemu and docker environment on x86_64 by multiarch/ubuntu-core:armhf-bionic docker image.
But in this image, rustup through proxy works fine.

@kinnison
Copy link
Contributor

Thanks. Hopefully I'll be able to get someone at the conference to help me reproduce this.

@shuyer520
Copy link

I have the similar problems, but I don't know how to resolve it. I need your help ,thankyou very much:

curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly

info: downloading installer

Welcome to Rust!

This will download and install the official compiler for the Rust programming
language, and its package manager, Cargo.

It will add the cargo, rustc, rustup and other commands to Cargo's bin
directory, located at:

/root/.cargo/bin

This path will then be added to your PATH environment variable by modifying the
profile file located at:

/root/.profile

You can uninstall at any time with rustup self uninstall and these changes will
be reverted.

Current installation options:

default host triple: x86_64-unknown-linux-gnu
default toolchain: nightly
modify PATH variable: yes

  1. Proceed with installation (default)
  2. Customize installation
  3. Cancel installation

1

info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256' to '/root/.rustup/tmp/v503rbkomwx867u2_file'
info: caused by: failed to make network request
info: caused by: https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256: error trying to connect: error:1408F10B:SSL routines:ssl3_get_record:wrong version number:ssl/record/ssl3_record.c:332:

@shuyer520
Copy link

I run# curl https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256
e6118276ddab3e00a967e11583685e3205564e31e4007968056ffd0878db19c0 channel-rust-stable.toml
It's good

@RainKolwa
Copy link

It worked after I disabled network proxy...

@kinnison
Copy link
Contributor

@RainKolwa It would be super-helpful if you could provide an example of your proxy setup. Our shift from cURL to reqwest as an HTTP backend should have been feature-compatible, but clearly it's not quite.

@RainKolwa
Copy link

Proceed with installing necessary dependencies? (y/N) > y
Installing Rust......
curl: (6) Could not resolve host: sh.rustup.rs
info: syncing channel updates for 'stable-x86_64-apple-darwin'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/Users/rainkolwa/.rustup/tmp/uqiwckx1xkh2e6ut_file'
info: checking for self-updates
error: could not download file from 'https://static.rust-lang.org/rustup/release-stable.toml' to '/var/folders/jg/1df1nfns585bgmvwbz_llyb40000gq/T/rustup-update.2UA22XK8IRTO/release-stable.toml'
info: caused by: failed to make network request
info: caused by: https://static.rust-lang.org/rustup/release-stable.toml: timed out

I mean I disabled the Proxy, actually I was using shadowsocks, and then I turned it off.

@kinnison
Copy link
Contributor

Aah so you had a proxy but hadn't got the environment variables for it. I understand, okay thanks.

@rbtcollins
Copy link
Contributor

@kinnison shadowsocks is a MITM socket level proxy - https://shadowsocks.org/en/index.html - not an HTTP proxy.

I think this is a case of an attractive-nuisance bug title: its likely that none of the reports are connected, but they all show the same error, so we have a dogpile. I suggest closing this and being super quick about retitling all new reports.

@kinnison
Copy link
Contributor

I agree with that, and will close this now. For future download problems, please file new issues with specific titles.

@mordmckee
Copy link

It worked after I disabled network proxy...

Turned off VPN here...

@MostafaNorzade
Copy link

I have strat Tor ( service tor start ) of course after installing the Tor.
Then install Rust.

@LoZeno
Copy link

LoZeno commented Feb 14, 2020

I'm experiencing this error today. I am not on a VPN nor have a proxy. Curl doesn't seem to have an issue though.

❯ rustup -v check
verbose: read metadata version: '12'
verbose: creating temp file: C:\Users\me\scoop\persist\rustup-msvc\.rustup\tmp\vhidjyjekzmi4ehm_file
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256'
verbose: downloading with reqwest
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to 'C:\Users\me\scoop\persist\rustup-msvc\.rustup\tmp\vhidjyjekzmi4ehm_file'
error: caused by: failed to make network request
error: caused by: https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256: timed out
❯ curl https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256
3e3e5ceacb9fb98d08660fcdc22554a8e074cfce4e94b0eb19b5b261893db71e  channel-rust-stable.toml

@kinnison
Copy link
Contributor

@LoZeno It would help if you could get a network trace of what rustup is doing when it times out.

@felipenoris
Copy link

This error started to happen yesterday, on a Linux server behind proxy:

$ rustup update                                                                                                             
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'                                                                             
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/rhome/FNORO/.rustup/tmp/_y_ere184wm
ljyms_file'                                                                                                                                     
info: checking for self-updates                                                                                                                 
error: could not download file from 'https://static.rust-lang.org/rustup/release-stable.toml' to '/tmp/rustup-updateZ2cEVV/release-stable.toml' 
error: caused by: failed to make network request                                                                                                
error: caused by: error sending request for url (https://static.rust-lang.org/rustup/release-stable.toml): operation timed out                  
error: caused by: operation timed out

@kinnison
Copy link
Contributor

kinnison commented Jul 8, 2020

@felipenoris In future it's better to open a fresh issue for new problems. In this case though, we're aware there's a bug in the proxy code and we're working on getting a fix out ASAP.

@dzhang-b
Copy link

confirmed. same error when the machine is behind a proxy with http_proxy environment var set.

@kinnison
Copy link
Contributor

@dzhang-b Please either find an open issue which appears related, or else open a fresh issue with your situation in it. Especially important is to consider the error you get if you specify --verbose when updating; and also the kind of proxy you're trying to use.

@dzhang-b
Copy link

@kinnison Sure. I will open a new issue with it.

@thardie
Copy link

thardie commented Dec 22, 2021

What a spectacularly bad experience for new rust users. I have this same error. I have no http or https proxies set. Curl can download just fine WITHOUT a proxy. Very bad first impression of this. Standard Ubuntu 20.04 LTS

info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/home/terry/.rustup/tmp/l6iooajjzu4sbq0v_file': failed to make network request: error sending request for url (https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256): operation timed out: operation timed out
terry@Breach:~/git/gateway-rs$ curl -v https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256
*   Trying 54.230.15.127:443...
* TCP_NODELAY set
* Connected to static.rust-lang.org (54.230.15.127) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=doc.rust-lang.org
*  start date: Jun 23 00:00:00 2021 GMT
*  expire date: Jul 22 23:59:59 2022 GMT
*  subjectAltName: host "static.rust-lang.org" matched cert's "static.rust-lang.org"
*  issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x563be3f8fd40)
> GET /dist/channel-rust-stable.toml.sha256 HTTP/2
> Host: static.rust-lang.org
> user-agent: curl/7.68.0
> accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
< HTTP/2 200
< content-type: binary/octet-stream
< content-length: 91
< date: Wed, 22 Dec 2021 00:56:22 GMT
< last-modified: Thu, 02 Dec 2021 14:51:55 GMT
< etag: "d70ce259a9030057108ad60ec9ebd4ed"
< x-amz-version-id: J9y_PITgr8VFF9fB2EMf7rFawlu_HNXl
< accept-ranges: bytes
< server: AmazonS3
< x-cache: Hit from cloudfront
< via: 1.1 4a19df966da88006816fbfa475b144f9.cloudfront.net (CloudFront)
< x-amz-cf-pop: ORD51-C4
< x-amz-cf-id: Tuh2b72j-boB4qrVmDcxNVtiWYT9YKyw_vsdvxL5M0Ria_HAPvnKRg==
< age: 15705
<
e8f7c18df088f4368d4721a28049ae50fda971a996b1619ce20ed23441ea0f67  channel-rust-stable.toml
* Connection #0 to host static.rust-lang.org left intact

@kinnison
Copy link
Contributor

@thardie That is very unfortunate looking. Could you please open a fresh issue so that we can discuss things there? Though when you do, please include some indication of your IP setup (both v4 and v6) since I'm starting to suspect this is something to do with falling back from v6 to v4 incorrectly.

@thardie
Copy link

thardie commented Dec 23, 2021

@thardie That is very unfortunate looking. Could you please open a fresh issue so that we can discuss things there? Though when you do, please include some indication of your IP setup (both v4 and v6) since I'm starting to suspect this is something to do with falling back from v6 to v4 incorrectly.

Opened #2929

@surferwat
Copy link

Any updates to solution for this issue?
I'm on Ubuntu 20.04.4 LTS.
And I am getting a "unable to get local issuer certificate" error when trying to install with the following command:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

@jakobilobi
Copy link

Also looking for updates on this issue!

Using the install script gives me:

./rustup-init.sh -v

...

info: profile set to 'default'
info: default host triple is x86_64-unknown-linux-gnu
verbose: installing toolchain 'stable-x86_64-unknown-linux-gnu'
verbose: toolchain directory: '/home/pjakob/.rustup/toolchains/stable-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
verbose: creating temp file: /home/pjakob/.rustup/tmp/4887q1824ltgdm97_file
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256'
verbose: downloading with reqwest
verbose: removing toolchain directory: '/home/pjakob/.rustup/toolchains/stable-x86_64-unknown-linux-gnu'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/home/pjakob/.rustup/tmp/4887q1824ltgdm97_file'

Caused by:
    0: failed to make network request
    1: error sending request for url (https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256): error trying to connect: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1915: (unable to get local issuer certificate)
    2: error trying to connect: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1915: (unable to get local issuer certificate)
    3: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1915: (unable to get local issuer certificate)
    4: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1915:

Seems to be something with the openssl connection, so let's check that. At first it gives return code 20 (error):

openssl s_client -connect static.rust-lang.org:443 -servername static.rust-lang.org -showcerts < /dev/null

...

SSL handshake has read 5500 bytes and written 376 bytes
Verification error: unable to get local issuer certificate
---
New, TLSv1.3, Cipher is TLS_AES_128_GCM_SHA256
Server public key is 2048 bit
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 20 (unable to get local issuer certificate)
---
DONE

Testing the openssl connection with my certs directory specified then gives return code 0 (OK):

openssl s_client -connect static.rust-lang.org:443 -servername static.rust-lang.org -showcerts -CApath /etc/ssl/certs/ < /dev/null

...

No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: X25519, 253 bits
---
SSL handshake has read 5500 bytes and written 376 bytes
Verification: OK
---
New, TLSv1.3, Cipher is TLS_AES_128_GCM_SHA256
Server public key is 2048 bit
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---
DONE

It definitely seems related to SSL/OpenSSL somehow but it's beyond my knowledge how to take it from here. Suggestions?

@reducio
Copy link

reducio commented Jun 27, 2022

Probably a problem with network settings, for normal work just try Cloudflare WARP. Working for me.

@CastelloDev
Copy link

I had the same issue, what worked for me was removing my .ssh/config file. Then running the command again.

@fly-duck
Copy link

  1. unset http_proxy
  2. unset https_proxy
  3. Then turned off network proxy through network setting.
    Those 3 steps work for me.

@iruizr7
Copy link

iruizr7 commented Jul 4, 2023

See #1400 (comment), this was my case inside a Docker container. Don't know what network config inside the container made the reqwest backend unusable.

@zzrs123
Copy link

zzrs123 commented Nov 11, 2023

if you are in china, try use aliyun source.
"try again" is truly a good suggestion.

@adamjc
Copy link

adamjc commented Dec 1, 2023

Same issues here, using wsl

@rem-aster
Copy link

@adamjc
try disabling vpn/proxy, terminate wsl (ex: wsl -t Ubuntu) and then try installing again, it worked for me.

@rzr
Copy link

rzr commented Jan 27, 2025

Thanks for hints I sorted it by disabling vpn that break SSL root of trust...

It would help to have rustup-init supporting an envar like RUSTUP_USE_CURL=1 to allow insecure download

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests