Skip to content

rustup install behind a corporate proxy fails with TLS handshake eof #4305

Open
@muja

Description

@muja

Verification

Problem

When running rustup behind a corporate proxy (without RUSTUP_USE_CURL=1) this error is produced:

❯ https_proxy=http://our.corporate.proxy:8080 rustup -v install beta     
debug: read metadata version: '12'
debug: installing toolchain 'beta-x86_64-unknown-linux-gnu'
debug: toolchain directory: '/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'beta-x86_64-unknown-linux-gnu'
debug: creating temp file: /home/user/.rustup/tmp/fr9g80t5bbku20gz_file
debug: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256'
debug: downloading with reqwest
debug: removing toolchain directory: '/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256' to '/home/user/.rustup/tmp/fr9g80t5bbku20gz_file'

Caused by:
    0: failed to make network request
    1: error sending request for url (https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256)
    2: client error (Connect)
    3: tls handshake eof

Dropping the protocol from the environment variable makes no difference. Adding RUSTUP_USE_CURL=1 fixes it, but apparently that's deprecated.

One thing that may be relevant is that the corporate proxy is some kind of Fortinet Proxy and does not support the zstd encoding, although it doesn't seem that the site tries to send it, even if advertised in Accept-Encoding header:

❯ https_proxy=http://our.corporate.proxy:8080 curl -H'Accept-Encoding: gzip, deflate, br, zstd' https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256 -i  
HTTP/1.1 200 Connection established
Proxy-Agent: Fortinet-Proxy/1.0

HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 89
x-amz-id-2: mXql6d23ngh+97LxTHAn6Xi9gwAKFzEF+Nav+Dt2XiM5MqhadLZhXUFx03fDBML0wVNr/ViEskSezEkcmUE25w==
x-amz-request-id: BTXNY0ZSHN2XNP9X
x-amz-storage-class: INTELLIGENT_TIERING
x-amz-server-side-encryption: AES256
x-amz-version-id: GU3vQbCUgbROXsRF6.3A_9u1QAIw8NjY
X-Served-By: cache-mxp6978-MXP
X-Cache: HIT
X-Cache-Hits: 1
X-Timer: S1745567961.974974,VS0,VE1
Last-Modified: Sun, 20 Apr 2025 02:19:51 GMT
ETag: "d3aaf2159800ee081e95612b2de0f7c3"
Content-Type: binary/octet-stream
Server: AmazonS3
Accept-Ranges: bytes
Date: Fri, 25 Apr 2025 07:59:20 GMT
Via: 1.1 varnish
Age: 5

dcf745f4f5daf2f9f5285edc4d2eb37f0a62297933c20c1727e15fa6edf5baa0  channel-rust-beta.toml

Steps

Output with RUSTUP_LOG=TRACE:

❯ RUSTUP_LOG=trace https_proxy=http://our.corporate.proxy:8080 rustup -v install beta
2025-04-25T08:04:14.263604Z DEBUG run_rustup:run_rustup_inner:main:set_globals: rustup::cli::common: read metadata version: '12' process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } current_dir="/projects" process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } args="[\"rustup\", \"-v\", \"install\", \"beta\"]" current_dir="/projects" quiet=false process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true })
2025-04-25T08:04:14.264681Z DEBUG run_rustup:run_rustup_inner:main:install:install: rustup::cli::common: installing toolchain 'beta-x86_64-unknown-linux-gnu' process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } current_dir="/projects" process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } args="[\"rustup\", \"-v\", \"install\", \"beta\"]"
2025-04-25T08:04:14.264696Z DEBUG run_rustup:run_rustup_inner:main:install:install: rustup::cli::common: toolchain directory: '/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu' process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } current_dir="/projects" process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } args="[\"rustup\", \"-v\", \"install\", \"beta\"]"
2025-04-25T08:04:14.264747Z  INFO run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::cli::common: syncing channel updates for 'beta-x86_64-unknown-linux-gnu' process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } current_dir="/projects" process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } args="[\"rustup\", \"-v\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T08:04:14.264819Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::cli::common: creating temp file: /home/user/.rustup/tmp/yabreatzi_qioeza_file process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } current_dir="/projects" process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } args="[\"rustup\", \"-v\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T08:04:14.264883Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::cli::common: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256' process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } current_dir="/projects" process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } args="[\"rustup\", \"-v\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T08:04:14.264894Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::cli::common: downloading with reqwest process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } current_dir="/projects" process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } args="[\"rustup\", \"-v\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T08:04:14.265034Z TRACE run_rustup:run_rustup_inner:main:install:install:update_from_dist: hyper_util::client::legacy::connect::http: Http::connect; scheme=Some("http"), host=Some("our.corporate.proxy"), port=Some(Port(8080)) process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } current_dir="/projects" process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } args="[\"rustup\", \"-v\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T08:04:14.287246Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: hyper_util::client::legacy::connect::http: connecting to 10.176.85.66:8080 process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } current_dir="/projects" process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } args="[\"rustup\", \"-v\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T08:04:14.292956Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: hyper_util::client::legacy::connect::http: connected to 10.176.85.66:8080 process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } current_dir="/projects" process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } args="[\"rustup\", \"-v\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T08:04:14.321579Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::cli::common: removing toolchain directory: '/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu' process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } current_dir="/projects" process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } args="[\"rustup\", \"-v\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T08:04:14.321640Z TRACE run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::dist: error=could not download file from 'https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256' to '/home/user/.rustup/tmp/yabreatzi_qioeza_file' process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } current_dir="/projects" process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } args="[\"rustup\", \"-v\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T08:04:14.321680Z TRACE run_rustup:run_rustup_inner:main:install:install: rustup::install: error=could not download file from 'https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256' to '/home/user/.rustup/tmp/yabreatzi_qioeza_file' process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } current_dir="/projects" process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } args="[\"rustup\", \"-v\", \"install\", \"beta\"]"
2025-04-25T08:04:14.321712Z TRACE run_rustup:run_rustup_inner:main:install: rustup::toolchain::distributable: error=could not download file from 'https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256' to '/home/user/.rustup/tmp/yabreatzi_qioeza_file' process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } current_dir="/projects" process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } args="[\"rustup\", \"-v\", \"install\", \"beta\"]"
2025-04-25T08:04:14.321751Z TRACE run_rustup:run_rustup_inner: rustup_init: error=could not download file from 'https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256' to '/home/user/.rustup/tmp/yabreatzi_qioeza_file' process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> } process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true }) console_filter=Handle { inner: (Weak), _s: PhantomData<fn(tracing_subscriber::registry::sharded::Registry)> }
2025-04-25T08:04:14.321788Z ERROR rustup::cli::common: could not download file from 'https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256' to '/home/user/.rustup/tmp/yabreatzi_qioeza_file'

Caused by:
    0: failed to make network request
    1: error sending request for url (https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256)
    2: client error (Connect)
    3: tls handshake eof

Possible Solution(s)

No response

Notes

No response

Rustup version

rustup --version
rustup 1.28.1 (f9edccde0 2025-03-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.88.0-nightly (a15cce269 2025-04-17)`

Installed toolchains

rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/user/.rustup

installed toolchains
--------------------
stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (active, default)

active toolchain
----------------
name: nightly-x86_64-unknown-linux-gnu
active because: it's the default toolchain
installed targets:
  x86_64-unknown-linux-gnu

OS version

cat /etc/*release
NAME="Red Hat Enterprise Linux"
VERSION="9.5 (Plow)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="9.5"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Red Hat Enterprise Linux 9.5 (Plow)"
ANSI_COLOR="0;31"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:redhat:enterprise_linux:9::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9"
BUG_REPORT_URL="https://issues.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 9"
REDHAT_BUGZILLA_PRODUCT_VERSION=9.5
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.5"
Red Hat Enterprise Linux release 9.5 (Plow)
Red Hat Enterprise Linux release 9.5 (Plow)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions