Skip to content

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

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

Open
2 tasks done
muja opened this issue Apr 25, 2025 · 52 comments
Open
2 tasks done

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

muja opened this issue Apr 25, 2025 · 52 comments
Labels
Milestone

Comments

@muja
Copy link

muja commented Apr 25, 2025

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)
@muja muja added the bug label Apr 25, 2025
@rami3l
Copy link
Member

rami3l commented Apr 25, 2025

cc @djc since the above log looks related to the download/TLS backend.

@djc djc mentioned this issue Apr 25, 2025
@djc
Copy link
Contributor

djc commented Apr 25, 2025

@muja thanks for the detailed report. Could you try this with a build from #4307?

@muja
Copy link
Author

muja commented Apr 25, 2025

Sure, some instructions would be appreciated, a cargo build didn't produce a binary:

rustup on  download-errors is 📦 v1.28.2 via 🦀 v1.88.0-nightly 
❯ ls target/debug/
build  deps  examples  incremental

@rami3l
Copy link
Member

rami3l commented Apr 25, 2025

Sure, some instructions would be appreciated

@muja Can you see the download links in https://github.com/rust-lang/rustup/actions/runs/14660975811?pr=4307?

@djc
Copy link
Contributor

djc commented Apr 25, 2025

Works for me:

djc-2021 download-errors rustup $ cargo clean && cargo build
     Removed 7820 files, 1.6GiB total
   Compiling proc-macro2 v1.0.95
   .
   .
   .
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 27.61s
djc-2021 download-errors rustup $ ls -l target/debug 
drwxr-xr-x    - djc 25 Apr 11:18 build
drwxr-xr-x    - djc 25 Apr 11:19 deps
drwxr-xr-x    - djc 25 Apr 11:18 examples
drwxr-xr-x    - djc 25 Apr 11:19 incremental
.rw-r--r-- 2.5k djc 25 Apr 11:19 librustup.d
.rw-r--r--  39M djc 25 Apr 11:19 librustup.rlib
.rwxr-xr-x  40M djc 25 Apr 11:19 rustup-init
.rw-r--r-- 2.6k djc 25 Apr 11:19 rustup-init.d

You'll want to use ln -s target/debug/rustup-init target/debug/rustup and then invoke ./target/debug/rustup directly instead of using cargo run, though.

@ctz
Copy link
Contributor

ctz commented Apr 25, 2025

tls handshake eof originates from tokio-rustls, and signifies the connection was closed at the TCP level unexpectedly during the TLS handshake. Unfortunately I think that means there are no avenues for further debugging at the client end.

@muja
Copy link
Author

muja commented Apr 25, 2025

Sure, some instructions would be appreciated

@muja Can you see the download links in https://github.com/rust-lang/rustup/actions/runs/14660975811?pr=4307?

Yeah that works. The logs with the new build:

❯ RUSTUP_LOG=trace ./rustup install beta
2025-04-25T09:27:35.802458Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" current_dir="/tmp/tmp.GMa5EgKV42/rustup" quiet=false process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true })
2025-04-25T09:27:35.803662Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]"
2025-04-25T09:27:35.803677Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]"
2025-04-25T09:27:35.803753Z  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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T09:27:35.803821Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::cli::common: creating temp file: /home/user/.rustup/tmp/z57wgwaqjemppfbu_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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T09:27:35.803886Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T09:27:35.803897Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T09:27:35.804052Z 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.corpoate.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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T09:27:35.808679Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: hyper_util::client::legacy::connect::http: connecting to 10.176.85.20: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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T09:27:35.810588Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: hyper_util::client::legacy::connect::http: connected to 10.176.85.20: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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T09:27:36.003257Z ERROR run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::download::reqwest_be: failed to download file error=error sending request for url (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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T09:27:36.003349Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T09:27:36.003371Z 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/z57wgwaqjemppfbu_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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T09:27:36.003385Z 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/z57wgwaqjemppfbu_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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]"
2025-04-25T09:27:36.003395Z 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/z57wgwaqjemppfbu_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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]"
2025-04-25T09:27:36.003411Z 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/z57wgwaqjemppfbu_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-25T09:27:36.003425Z 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/z57wgwaqjemppfbu_file': failed to make network request: error sending request for url (https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256): client error (Connect): tls handshake eof

FWIW the reason cargo build didn't produce any binaries is because it couldn't find an OPENSSL directory, I completely missed that. No idea if that is related or belongs here, but here is the output:

warning: openssl-sys@0.9.107: Could not find directory of OpenSSL installation, and this `-sys` crate cannot proceed without this knowledge. If OpenSSL is installed and this crate had trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the compilation process. See stderr section below for further information.
error: failed to run custom build command for `openssl-sys v0.9.107`

Caused by:
  process didn't exit successfully: `/tmp/tmp.GMa5EgKV42/rustup/target/debug/build/openssl-sys-d6ce3b6d82c3b015/build-script-main` (exit status: 101)
  --- stdout
  cargo:rustc-check-cfg=cfg(osslconf, values("OPENSSL_NO_OCB", "OPENSSL_NO_SM4", "OPENSSL_NO_SEED", "OPENSSL_NO_CHACHA", "OPENSSL_NO_CAST", "OPENSSL_NO_IDEA", "OPENSSL_NO_CAMELLIA", "OPENSSL_NO_RC4", "OPENSSL_NO_BF", "OPENSSL_NO_PSK", "OPENSSL_NO_DEPRECATED_3_0", "OPENSSL_NO_SCRYPT", "OPENSSL_NO_SM3", "OPENSSL_NO_RMD160", "OPENSSL_NO_EC2M", "OPENSSL_NO_OCSP", "OPENSSL_NO_CMS", "OPENSSL_NO_COMP", "OPENSSL_NO_SOCK", "OPENSSL_NO_STDIO", "OPENSSL_NO_EC", "OPENSSL_NO_SSL3_METHOD", "OPENSSL_NO_KRB5", "OPENSSL_NO_TLSEXT", "OPENSSL_NO_SRP", "OPENSSL_NO_RFC3779", "OPENSSL_NO_SHA", "OPENSSL_NO_NEXTPROTONEG", "OPENSSL_NO_ENGINE", "OPENSSL_NO_BUF_FREELISTS", "OPENSSL_NO_RC2"))
  cargo:rustc-check-cfg=cfg(openssl)
  cargo:rustc-check-cfg=cfg(libressl)
  cargo:rustc-check-cfg=cfg(boringssl)
  cargo:rustc-check-cfg=cfg(awslc)
  cargo:rustc-check-cfg=cfg(libressl250)
  cargo:rustc-check-cfg=cfg(libressl251)
  cargo:rustc-check-cfg=cfg(libressl252)
  cargo:rustc-check-cfg=cfg(libressl261)
  cargo:rustc-check-cfg=cfg(libressl270)
  cargo:rustc-check-cfg=cfg(libressl271)
  cargo:rustc-check-cfg=cfg(libressl273)
  cargo:rustc-check-cfg=cfg(libressl280)
  cargo:rustc-check-cfg=cfg(libressl281)
  cargo:rustc-check-cfg=cfg(libressl291)
  cargo:rustc-check-cfg=cfg(libressl310)
  cargo:rustc-check-cfg=cfg(libressl321)
  cargo:rustc-check-cfg=cfg(libressl332)
  cargo:rustc-check-cfg=cfg(libressl340)
  cargo:rustc-check-cfg=cfg(libressl350)
  cargo:rustc-check-cfg=cfg(libressl360)
  cargo:rustc-check-cfg=cfg(libressl361)
  cargo:rustc-check-cfg=cfg(libressl370)
  cargo:rustc-check-cfg=cfg(libressl380)
  cargo:rustc-check-cfg=cfg(libressl381)
  cargo:rustc-check-cfg=cfg(libressl382)
  cargo:rustc-check-cfg=cfg(libressl390)
  cargo:rustc-check-cfg=cfg(libressl400)
  cargo:rustc-check-cfg=cfg(libressl410)
  cargo:rustc-check-cfg=cfg(ossl101)
  cargo:rustc-check-cfg=cfg(ossl102)
  cargo:rustc-check-cfg=cfg(ossl102f)
  cargo:rustc-check-cfg=cfg(ossl102h)
  cargo:rustc-check-cfg=cfg(ossl110)
  cargo:rustc-check-cfg=cfg(ossl110f)
  cargo:rustc-check-cfg=cfg(ossl110g)
  cargo:rustc-check-cfg=cfg(ossl110h)
  cargo:rustc-check-cfg=cfg(ossl111)
  cargo:rustc-check-cfg=cfg(ossl111b)
  cargo:rustc-check-cfg=cfg(ossl111c)
  cargo:rustc-check-cfg=cfg(ossl111d)
  cargo:rustc-check-cfg=cfg(ossl300)
  cargo:rustc-check-cfg=cfg(ossl310)
  cargo:rustc-check-cfg=cfg(ossl320)
  cargo:rustc-check-cfg=cfg(ossl330)
  cargo:rustc-check-cfg=cfg(ossl340)
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
  OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
  OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_DIR
  OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=OPENSSL_STATIC
  cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR


  Could not find openssl via pkg-config:

  pkg-config exited with status code 1
  > PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags openssl

  The system library `openssl` required by crate `openssl-sys` was not found.
  The file `openssl.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
  The PKG_CONFIG_PATH environment variable is not set.

  HINT: if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing `openssl.pc`.


  cargo:warning=Could not find directory of OpenSSL installation, and this `-sys` crate cannot proceed without this knowledge. If OpenSSL is installed and this crate had trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the compilation process. See stderr section below for further information.

  --- stderr


  Could not find directory of OpenSSL installation, and this `-sys` crate cannot
  proceed without this knowledge. If OpenSSL is installed and this crate had
  trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
  compilation process.

  Make sure you also have the development packages of openssl installed.
  For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.

  If you're in a situation where you think the directory *should* be found
  automatically, please open a bug at https://github.com/sfackler/rust-openssl
  and include information about your system as well as this message.

  $HOST = x86_64-unknown-linux-gnu
  $TARGET = x86_64-unknown-linux-gnu
  openssl-sys = 0.9.107


warning: build failed, waiting for other jobs to finish...

@djc
Copy link
Contributor

djc commented Apr 25, 2025

FWIW the reason cargo build didn't produce any binaries is because it couldn't find an OPENSSL directory, I completely missed that. No idea if that is related or belongs here, but here is the output:

For now you'll need to build OpenSSL to build rustup in the default configuration... that's the thing we're trying to fix here.

@muja
Copy link
Author

muja commented Apr 25, 2025

Okay, and how do I do that? I couldn't find a openssl.pc on the machine, and I cannot install any packages due to missing privileges.

@djc
Copy link
Contributor

djc commented Apr 25, 2025

It might be easier to drop that stuff for now, try cargo build --no-default-features --features reqwest-rustls-tls?

@muja
Copy link
Author

muja commented Apr 25, 2025

That works, the output (if at all different from my previous comment):

❯ RUSTUP_LOG=trace ./rustup install beta
2025-04-25T10:07:31.974791Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" current_dir="/tmp/tmp.GMa5EgKV42/rustup" quiet=false process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true })
2025-04-25T10:07:31.980799Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]"
2025-04-25T10:07:31.980838Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]"
2025-04-25T10:07:31.981002Z  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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:07:31.981199Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::cli::common: creating temp file: /home/user/.rustup/tmp/te9mzdmyqkmi7shc_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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:07:31.981300Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:07:31.981333Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:07:31.981775Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:07:31.989542Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: hyper_util::client::legacy::connect::http: connecting to 10.176.85.20: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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:07:31.992136Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: hyper_util::client::legacy::connect::http: connected to 10.176.85.20: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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:07:32.068371Z ERROR run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::download::reqwest_be: failed to download file error=error sending request for url (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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:07:32.068490Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:07:32.068543Z 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/te9mzdmyqkmi7shc_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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:07:32.068594Z 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/te9mzdmyqkmi7shc_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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]"
2025-04-25T10:07:32.068633Z 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/te9mzdmyqkmi7shc_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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]"
2025-04-25T10:07:32.068687Z 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/te9mzdmyqkmi7shc_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-25T10:07:32.068730Z 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/te9mzdmyqkmi7shc_file': failed to make network request: error sending request for url (https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256): client error (Connect): tls handshake eof

@djc
Copy link
Contributor

djc commented Apr 25, 2025

Ugh, that error is useless.

@djc
Copy link
Contributor

djc commented Apr 25, 2025

Alright, this might help a little bit: #4309.

@muja
Copy link
Author

muja commented Apr 25, 2025

At this point I'm just checking out the specific branch and building/running, trusting that you don't put a backdoor in there somewhere

rustup on  error-debug [?] is 📦 v1.28.2 via 🦀 v1.88.0-nightly 
⬢ ❯ RUSTUP_LOG=trace ./rustup install beta
2025-04-25T10:22:09.148828Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" current_dir="/tmp/tmp.GMa5EgKV42/rustup" quiet=false process=OsProcess(OsProcess { stderr_is_a_tty: true, stdout_is_a_tty: true })
2025-04-25T10:22:09.155217Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]"
2025-04-25T10:22:09.155263Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]"
2025-04-25T10:22:09.155430Z  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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:22:09.155633Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::cli::common: creating temp file: /home/user/.rustup/tmp/m6ca0_uve6k1hpzk_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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:22:09.155748Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:22:09.155784Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:22:09.156324Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:22:09.163808Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: hyper_util::client::legacy::connect::http: connecting to 10.176.85.20: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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:22:09.166696Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: hyper_util::client::legacy::connect::http: connected to 10.176.85.20: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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:22:09.193801Z ERROR run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::download::reqwest_be: failed to download file error=Reqwest(reqwest::Error { kind: Request, url: "https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256", source: hyper_util::client::legacy::Error(Connect, Custom { kind: UnexpectedEof, error: "tls handshake eof" }) }) 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:22:09.193927Z 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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:22:09.193980Z 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/m6ca0_uve6k1hpzk_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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T10:22:09.194042Z 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/m6ca0_uve6k1hpzk_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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]"
2025-04-25T10:22:09.194082Z 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/m6ca0_uve6k1hpzk_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="/tmp/tmp.GMa5EgKV42/rustup" 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\", \"install\", \"beta\"]"
2025-04-25T10:22:09.194140Z 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/m6ca0_uve6k1hpzk_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-25T10:22:09.194185Z 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/m6ca0_uve6k1hpzk_file': error downloading file: error sending request for url (https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256): client error (Connect): tls handshake eof

@rami3l
Copy link
Member

rami3l commented Apr 25, 2025

@djc @muja Does #4310 change anything WRT the output? Ideally it should output more stuff if the libs have log enabled, but I'm not quite sure...

@muja
Copy link
Author

muja commented Apr 25, 2025

I see it was merged to master?
I rebuilt from master and this is the error log:

2025-04-25T11:59:52.549905Z DEBUG run_rustup:run_rustup_inner:main:set_globals: rustup::cli::common: read metadata version: '12' current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" current_dir="/tmp/tmp.pG4aiqSug8/rustup" quiet=false
2025-04-25T11:59:52.556124Z DEBUG run_rustup:run_rustup_inner:main:install:install: rustup::cli::common: installing toolchain 'beta-x86_64-unknown-linux-gnu' current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]"
2025-04-25T11:59:52.556166Z DEBUG run_rustup:run_rustup_inner:main:install:install: rustup::cli::common: toolchain directory: '/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu' current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]"
2025-04-25T11:59:52.556332Z  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' current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T11:59:52.556535Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::cli::common: creating temp file: /home/user/.rustup/tmp/pvwgd0197jjljxwr_file current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T11:59:52.556632Z 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' current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T11:59:52.556663Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::cli::common: downloading with reqwest current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T11:59:52.557071Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: reqwest::connect: starting new connection: https://static.rust-lang.org/     current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T11:59:52.557249Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: reqwest::connect: proxy(http://our.corporate.proxy:8080) intercepts 'https://static.rust-lang.org/'     current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T11:59:52.557321Z 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)) current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T11:59:52.574678Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: hyper_util::client::legacy::connect::http: connecting to 10.176.85.20:8080 current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T11:59:52.577875Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: hyper_util::client::legacy::connect::http: connected to 10.176.85.20:8080 current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T11:59:52.577938Z TRACE run_rustup:run_rustup_inner:main:install:install:update_from_dist: reqwest::connect: tunneling HTTPS over proxy     current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T11:59:52.682784Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::client::hs: No cached session for DnsName("static.rust-lang.org")     current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T11:59:52.683240Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::client::hs: Not resuming any session     current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T11:59:52.683409Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::webpki::anchors: add_parsable_certificates processed 0 valid and 0 invalid certs     current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T11:59:52.683530Z TRACE run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::client::hs: Sending ClientHello Message {
    version: TLSv1_0,
    payload: Handshake {
        parsed: HandshakeMessagePayload {
            typ: ClientHello,
            payload: ClientHello(
                ClientHelloPayload {
                    client_version: TLSv1_2,
                    random: d16c99467414251dd9198ba1356af7630e3e0e267a64469fbcb982301a2ccf25,
                    session_id: 9bea9d8d79d3702947ed12577f39e96bedc01361d863ec1d2a492f4b52a300f3,
                    cipher_suites: [
                        TLS13_AES_256_GCM_SHA384,
                        TLS13_AES_128_GCM_SHA256,
                        TLS13_CHACHA20_POLY1305_SHA256,
                        TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
                        TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
                        TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
                        TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
                        TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
                        TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
                        TLS_EMPTY_RENEGOTIATION_INFO_SCSV,
                    ],
                    compression_methods: [
                        Null,
                    ],
                    extensions: [
                        SessionTicket(
                            Request,
                        ),
                        SupportedVersions(
                            [
                                TLSv1_3,
                                TLSv1_2,
                            ],
                        ),
                        ExtendedMasterSecretRequest,
                        NamedGroups(
                            [
                                X25519,
                                secp256r1,
                                secp384r1,
                                X25519MLKEM768,
                            ],
                        ),
                        ServerName(
                            [
                                ServerName {
                                    typ: HostName,
                                    payload: HostName(
                                        DnsName(
                                            "static.rust-lang.org",
                                        ),
                                    ),
                                },
                            ],
                        ),
                        EcPointFormats(
                            [
                                Uncompressed,
                            ],
                        ),
                        SignatureAlgorithms(
                            [],
                        ),
                        PresharedKeyModes(
                            [
                                PSK_DHE_KE,
                            ],
                        ),
                        CertificateStatusRequest(
                            Ocsp(
                                OcspCertificateStatusRequest {
                                    responder_ids: [],
                                    extensions: ,
                                },
                            ),
                        ),
                        KeyShare(
                            [
                                KeyShareEntry {
                                    group: X25519,
                                    payload: 7fc9067623fa270beb8df1c1bc57686e3c317ca63e3d58b59ab29be6ec3dff7a,
                                },
                            ],
                        ),
                    ],
                },
            ),
        },
        encoded: 010000de0303d16c99467414251dd9198ba1356af7630e3e0e267a64469fbcb982301a2ccf25209bea9d8d79d3702947ed12577f39e96bedc01361d863ec1d2a492f4b52a300f30014130213011303c02cc02bcca9c030c02fcca800ff0100008100230000002b0005040304030300170000000a000a0008001d0017001811ec0000001900170000147374617469632e727573742d6c616e672e6f7267000b00020100000d00020000002d00020101000500050100000000003300260024001d00207fc9067623fa270beb8df1c1bc57686e3c317ca63e3d58b59ab29be6ec3dff7a,
    },
}     current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T11:59:52.695002Z ERROR run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::download::reqwest_be: failed to download file error=Reqwest(reqwest::Error { kind: Request, url: "https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256", source: hyper_util::client::legacy::Error(Connect, Custom { kind: UnexpectedEof, error: "tls handshake eof" }) }) current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T11:59:52.695135Z 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' current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T11:59:52.695182Z 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/pvwgd0197jjljxwr_file' current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T11:59:52.695232Z 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/pvwgd0197jjljxwr_file' current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]"
2025-04-25T11:59:52.695268Z 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/pvwgd0197jjljxwr_file' current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]"
2025-04-25T11:59:52.695326Z 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/pvwgd0197jjljxwr_file'
2025-04-25T11:59:52.695370Z 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/pvwgd0197jjljxwr_file': error downloading file: error sending request for url (https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256): client error (Connect): tls handshake eof

@djc
Copy link
Contributor

djc commented Apr 25, 2025

Okay, so it looks like the proxy is just closing the TCP connection once rustls sends the TLS ClientHello. I suggest you contact support -- maybe using the forum on the Fortinet website?

@ctz
Copy link
Contributor

ctz commented Apr 25, 2025

I see it was merged to master?
I rebuilt from master and this is the error log:

As another data point, could you apply this patch and try again?

diff --git a/Cargo.toml b/Cargo.toml
index 9f19b5a9..0a55e6b9 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -70,7 +70,7 @@ remove_dir_all = { version = "1.0.0", features = ["parallel"] }
 reqwest = { version = "0.12", default-features = false, features = ["blocking", "gzip", "socks", "stream"], optional = true }
 retry = { version = "2", default-features = false, features = ["random"] }
 rs_tracing = { version = "1.1", features = ["rs_tracing"] }
-rustls = { version = "0.23", optional = true, default-features = false, features = ["logging", "aws_lc_rs", "tls12"] }
+rustls = { version = "0.23", optional = true, default-features = false, features = ["logging", "aws_lc_rs", "tls12", "prefer-post-quantum"] }
 rustls-platform-verifier = { version = "0.5", optional = true }
 same-file = "1"
 semver = "1.0"

Thanks!

@muja
Copy link
Author

muja commented Apr 25, 2025

This is not acceptable. Using curl or anything else works flawlessly, here is the verbose output from curl:

❯ curl -vvvvvv https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256
* Uses proxy env variable no_proxy == '.cluster.local,.svc,10.0.0.0/8,100.64.0.0/10,127.0.0.0/8,localhost,127.0.0.1,100.65.0.1,100.65.0.0/10,.svc,100.65.0.1'
* Uses proxy env variable https_proxy == 'http://our.corporate.proxy:8080'
*   Trying 10.176.85.20:8080...
* Connected to our.corporate.proxy (10.176.85.20) port 8080 (#0)
* allocate connect buffer!
* Establish HTTP proxy tunnel to static.rust-lang.org:443
> CONNECT static.rust-lang.org:443 HTTP/1.1
> Host: static.rust-lang.org:443
> User-Agent: curl/7.76.1
> Proxy-Connection: Keep-Alive
> 
< HTTP/1.1 200 Connection established
< Proxy-Agent: Fortinet-Proxy/1.0
< 
* Proxy replied 200 to CONNECT request
* CONNECT phase completed!
* ALPN, offering h2
* ALPN, offering http/1.1
*  CAfile: /etc/pki/tls/certs/ca-bundle.crt
*  CApath: /var/run/secrets/kubernetes.io/serviceaccount
* TLSv1.0 (OUT), TLS header, Certificate Status (22):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* CONNECT phase completed!
* CONNECT phase completed!
* TLSv1.2 (IN), TLS header, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS header, Finished (20):
* TLSv1.2 (IN), TLS header, Unknown (23):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.2 (IN), TLS header, Unknown (23):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS header, Unknown (23):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.2 (IN), TLS header, Unknown (23):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.2 (OUT), TLS header, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS header, Unknown (23):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: CN=fastly-static.rust-lang.org
*  start date: Dec  8 09:51:12 2024 GMT
*  expire date: Apr 26 13:05:00 2025 GMT
*  subjectAltName: host "static.rust-lang.org" matched cert's "static.rust-lang.org"
*  issuer: C=COM; O=COMPANY; OU=ACME; CN=ACME Proxy CA 01 C
*  SSL certificate verify ok.
* TLSv1.2 (OUT), TLS header, Unknown (23):
> GET /dist/channel-rust-beta.toml.sha256 HTTP/1.1
> Host: static.rust-lang.org
> User-Agent: curl/7.76.1
> Accept: */*
> 
* TLSv1.2 (IN), TLS header, Unknown (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.2 (IN), TLS header, Unknown (23):
* Mark bundle as not supporting multiuse
< 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-mxp6975-MXP
< X-Cache: HIT
< X-Cache-Hits: 0
< X-Timer: S1745586300.893533,VS0,VE1
< Last-Modified: Sun, 20 Apr 2025 02:19:51 GMT
< ETag: "d3aaf2159800ee081e95612b2de0f7c3"
< Content-Type: binary/octet-stream
< Server: AmazonS3
< Accept-Ranges: bytes
< Age: 18344
< Date: Fri, 25 Apr 2025 13:04:59 GMT
< Via: 1.1 varnish
< 
dcf745f4f5daf2f9f5285edc4d2eb37f0a62297933c20c1727e15fa6edf5baa0  channel-rust-beta.toml
* Connection #0 to host our.corporate.proxy left intact

As such it is definitely an issue with rustup.

I even tested it out with my own binary, and it connects successfully. No idea what rustup is doing differently?

#[tokio::main]
async fn main() {
    let client = reqwest::ClientBuilder::new().use_rustls_tls().build().unwrap();
    let response = client.get("https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256").send().await.unwrap().text().await;
    println!("{response:?}");
}

prints:

❯ cargo run
   Compiling foo v0.1.0 (/projects/foo)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.80s
     Running `target/debug/foo`
Ok("dcf745f4f5daf2f9f5285edc4d2eb37f0a62297933c20c1727e15fa6edf5baa0  channel-rust-beta.toml\n")

Cargo.toml:

[package]
name = "foo"
version = "0.1.0"
edition = "2024"

[dependencies]
reqwest = { version = "0.12.15", default-features = false, features = ["rustls-tls", "rustls-tls-native-roots-no-provider"] }
tokio = { version = "1.44.2", features = ["full"] }

@djc
Copy link
Contributor

djc commented Apr 25, 2025

I even tested it out with my own binary, and it connects successfully. No idea what rustls is doing differently?

#[tokio::main]
async fn main() {
let client = reqwest::ClientBuilder::new().use_rustls_tls().build().unwrap();
let response = client.get("https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256").send().await.unwrap().text().await;
println!("{response:?}");
}

prints:

❯ cargo run
   Compiling foo v0.1.0 (/projects/foo)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.80s
     Running `target/debug/foo`
Ok("dcf745f4f5daf2f9f5285edc4d2eb37f0a62297933c20c1727e15fa6edf5baa0  channel-rust-beta.toml\n")

Cargo.toml:

[package]
name = "foo"
version = "0.1.0"
edition = "2024"

[dependencies]
reqwest = { version = "0.12.15", default-features = false, features = ["rustls-tls", "rustls-tls-native-roots-no-provider"] }
tokio = { version = "1.44.2", features = ["full"] }

Ahh, thanks for testing that, that is very interesting!

@djc
Copy link
Contributor

djc commented Apr 25, 2025

Can you try to replace the reqwest setup with this?

Client::builder()
            // HACK: set `pool_max_idle_per_host` to `0` to avoid an issue in the underlying
            // `hyper` library that causes the `reqwest` client to hang in some cases.
            // See <https://github.com/hyperium/hyper/issues/2312> for more details.
            .pool_max_idle_per_host(0)
            .gzip(false)
            .proxy(Proxy::custom(env_proxy))
            .read_timeout(Duration::from_secs(30))
                .use_preconfigured_tls(
                    rustls::ClientConfig::builder_with_provider(Arc::new(
                        aws_lc_rs::default_provider(),
                    ))
                    .with_safe_default_protocol_versions()
                    .unwrap()
                    .with_platform_verifier()
                    .with_no_client_auth(),
                )
                .user_agent(super::REQWEST_RUSTLS_TLS_USER_AGENT)
                .build()

Presumably one of these calls is causing the difference.

@muja
Copy link
Author

muja commented Apr 25, 2025

prefer-post-quantum

No difference

@ctz
Copy link
Contributor

ctz commented Apr 25, 2025

prefer-post-quantum

No difference

Thanks!

@muja
Copy link
Author

muja commented Apr 25, 2025

okay after adding all the dependencies, i was able to run it with this main:

use rustls_platform_verifier::*;
#[tokio::main]
async fn main() {
    let client = reqwest::Client::builder()
        // HACK: set `pool_max_idle_per_host` to `0` to avoid an issue in the underlying
        // `hyper` library that causes the `reqwest` client to hang in some cases.
        // See <https://github.com/hyperium/hyper/issues/2312> for more details.
        .pool_max_idle_per_host(0)
        .gzip(false)
        .read_timeout(std::time::Duration::from_secs(30))
        .use_preconfigured_tls(
            rustls::ClientConfig::builder_with_provider(std::sync::Arc::new(
                rustls::crypto::aws_lc_rs::default_provider(),
            ))
            .with_safe_default_protocol_versions()
            .unwrap()
            .with_platform_verifier()
            .with_no_client_auth(),
        )
        .user_agent("whatever")
        .build()
        .unwrap();
    let response = client
        .get("https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256")
        .send()
        .await
        .unwrap()
        .text()
        .await;
    println!("{response:?}");
}

output:

❯ cargo run
   Compiling foo v0.1.0 (/projects/foo)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.86s
     Running `target/debug/foo`
Ok("dcf745f4f5daf2f9f5285edc4d2eb37f0a62297933c20c1727e15fa6edf5baa0  channel-rust-beta.toml\n")

Cargo.toml

[package]
name = "foo"
version = "0.1.0"
edition = "2024"

[dependencies]
reqwest = { version = "0.12.15", default-features = false, features = ["gzip", "rustls-tls", "rustls-tls-native-roots-no-provider"] }
rustls = { version = "0.23", default-features = false, features = ["logging", "aws_lc_rs", "tls12"] }
tokio = { version = "1.44.2", features = ["full"] }
rustls-platform-verifier = { version = "0.5" }

@djc
Copy link
Contributor

djc commented Apr 25, 2025

@muja so that's the ClientHello from your test program? Can you grab one from rustup as well, and diff them?

I don't think the server certificate verifier (either rustls-platform-verifier or rustls-native-certs) should influence the ClientHello...

@ctz
Copy link
Contributor

ctz commented Apr 25, 2025

2025-04-25T14:45:49.330584Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::webpki::anchors: add_parsable_certificates processed 0 valid and 0 invalid certs     current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"

Very good spot. So that means rustls-platform-verifier will fail initialisation, and then it returns an empty list of verification algorithms (not super helpful) and that leads to the ClientHello being illegal. So that is one root cause, but it is still unclear why rustup in this context does not load any certificates...

@muja
Copy link
Author

muja commented Apr 25, 2025

From my program:

[2025-04-25T14:39:52Z TRACE rustls::client::hs] Sending ClientHello Message {
        version: TLSv1_0,
        payload: Handshake {
            parsed: HandshakeMessagePayload {
                typ: ClientHello,
                payload: ClientHello(
                    ClientHelloPayload {
                        client_version: TLSv1_2,
                        random: eff252c8d0dcf927248e2ca2597db5107aa5c22b52bbdcd2637932d6f4c56354,
                        session_id: c89d4319117547a38ad9563acdba70131d85b577b2438d712bf54e91a70d2d27,
                        cipher_suites: [
                            TLS13_AES_256_GCM_SHA384,
                            TLS13_AES_128_GCM_SHA256,
                            TLS13_CHACHA20_POLY1305_SHA256,
                            TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
                            TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
                            TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
                            TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
                            TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
                            TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
                            TLS_EMPTY_RENEGOTIATION_INFO_SCSV,
                        ],
                        compression_methods: [
                            Null,
                        ],
                        extensions: [
                            SessionTicket(
                                Request,
                            ),
                            KeyShare(
                                [
                                    KeyShareEntry {
                                        group: X25519,
                                        payload: 55702288539fca5f20219a360bb21bec8a4727c8ae2aea47108f42ecc758f15b,
                                    },
                                ],
                            ),
                            SupportedVersions(
                                [
                                    TLSv1_3,
                                    TLSv1_2,
                                ],
                            ),
                            SignatureAlgorithms(
                                [
                                    ECDSA_NISTP384_SHA384,
                                    ECDSA_NISTP256_SHA256,
                                    ECDSA_NISTP521_SHA512,
                                    ED25519,
                                    RSA_PSS_SHA512,
                                    RSA_PSS_SHA384,
                                    RSA_PSS_SHA256,
                                    RSA_PKCS1_SHA512,
                                    RSA_PKCS1_SHA384,
                                    RSA_PKCS1_SHA256,
                                ],
                            ),
                            ServerName(
                                [
                                    ServerName {
                                        typ: HostName,
                                        payload: HostName(
                                            DnsName(
                                                "static.rust-lang.org",
                                            ),
                                        ),
                                    },
                                ],
                            ),
                            ExtendedMasterSecretRequest,
                            EcPointFormats(
                                [
                                    Uncompressed,
                                ],
                            ),
                            NamedGroups(
                                [
                                    X25519,
                                    secp256r1,
                                    secp384r1,
                                    X25519MLKEM768,
                                ],
                            ),
                            CertificateStatusRequest(
                                Ocsp(
                                    OcspCertificateStatusRequest {
                                        responder_ids: [],
                                        extensions: ,
                                    },
                                ),
                            ),
                            PresharedKeyModes(
                                [
                                    PSK_DHE_KE,
                                ],
                            ),
                        ],
                    },
                ),
            },
            encoded: 010000f20303eff252c8d0dcf927248e2ca2597db5107aa5c22b52bbdcd2637932d6f4c5635420c89d4319117547a38ad9563acdba70131d85b577b2438d712bf54e91a70d2d270014130213011303c02cc02bcca9c030c02fcca800ff0100009500230000003300260024001d002055702288539fca5f20219a360bb21bec8a4727c8ae2aea47108f42ecc758f15b002b00050403040303000d0016001405030403060308070806080508040601050104010000001900170000147374617469632e727573742d6c616e672e6f726700170000000b00020100000a000a0008001d0017001811ec000500050100000000002d00020101,
        },
    }

from rustup:

2025-04-25T11:59:52.683530Z TRACE run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::client::hs: Sending ClientHello Message {
    version: TLSv1_0,
    payload: Handshake {
        parsed: HandshakeMessagePayload {
            typ: ClientHello,
            payload: ClientHello(
                ClientHelloPayload {
                    client_version: TLSv1_2,
                    random: d16c99467414251dd9198ba1356af7630e3e0e267a64469fbcb982301a2ccf25,
                    session_id: 9bea9d8d79d3702947ed12577f39e96bedc01361d863ec1d2a492f4b52a300f3,
                    cipher_suites: [
                        TLS13_AES_256_GCM_SHA384,
                        TLS13_AES_128_GCM_SHA256,
                        TLS13_CHACHA20_POLY1305_SHA256,
                        TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
                        TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
                        TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
                        TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
                        TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
                        TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
                        TLS_EMPTY_RENEGOTIATION_INFO_SCSV,
                    ],
                    compression_methods: [
                        Null,
                    ],
                    extensions: [
                        SessionTicket(
                            Request,
                        ),
                        SupportedVersions(
                            [
                                TLSv1_3,
                                TLSv1_2,
                            ],
                        ),
                        ExtendedMasterSecretRequest,
                        NamedGroups(
                            [
                                X25519,
                                secp256r1,
                                secp384r1,
                                X25519MLKEM768,
                            ],
                        ),
                        ServerName(
                            [
                                ServerName {
                                    typ: HostName,
                                    payload: HostName(
                                        DnsName(
                                            "static.rust-lang.org",
                                        ),
                                    ),
                                },
                            ],
                        ),
                        EcPointFormats(
                            [
                                Uncompressed,
                            ],
                        ),
                        SignatureAlgorithms(
                            [],
                        ),
                        PresharedKeyModes(
                            [
                                PSK_DHE_KE,
                            ],
                        ),
                        CertificateStatusRequest(
                            Ocsp(
                                OcspCertificateStatusRequest {
                                    responder_ids: [],
                                    extensions: ,
                                },
                            ),
                        ),
                        KeyShare(
                            [
                                KeyShareEntry {
                                    group: X25519,
                                    payload: 7fc9067623fa270beb8df1c1bc57686e3c317ca63e3d58b59ab29be6ec3dff7a,
                                },
                            ],
                        ),
                    ],
                },
            ),
        },
        encoded: 010000de0303d16c99467414251dd9198ba1356af7630e3e0e267a64469fbcb982301a2ccf25209bea9d8d79d3702947ed12577f39e96bedc01361d863ec1d2a492f4b52a300f30014130213011303c02cc02bcca9c030c02fcca800ff0100008100230000002b0005040304030300170000000a000a0008001d0017001811ec0000001900170000147374617469632e727573742d6c616e672e6f7267000b00020100000d00020000002d00020101000500050100000000003300260024001d00207fc9067623fa270beb8df1c1bc57686e3c317ca63e3d58b59ab29be6ec3dff7a,
    },
}     current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"

diff:

❯ diff target/rustup target/my
1c1
< 2025-04-25T11:59:52.683530Z TRACE run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::client::hs: Sending ClientHello Message {
---
> [2025-04-25T14:39:52Z TRACE rustls::client::hs] Sending ClientHello Message {
9,10c9,10
<                     random: d16c99467414251dd9198ba1356af7630e3e0e267a64469fbcb982301a2ccf25,
<                     session_id: 9bea9d8d79d3702947ed12577f39e96bedc01361d863ec1d2a492f4b52a300f3,
---
>                     random: eff252c8d0dcf927248e2ca2597db5107aa5c22b52bbdcd2637932d6f4c56354,
>                     session_id: c89d4319117547a38ad9563acdba70131d85b577b2438d712bf54e91a70d2d27,
29a30,37
>                         KeyShare(
>                             [
>                                 KeyShareEntry {
>                                     group: X25519,
>                                     payload: 55702288539fca5f20219a360bb21bec8a4727c8ae2aea47108f42ecc758f15b,
>                                 },
>                             ],
>                         ),
36,37c44
<                         ExtendedMasterSecretRequest,
<                         NamedGroups(
---
>                         SignatureAlgorithms(
39,42c46,55
<                                 X25519,
<                                 secp256r1,
<                                 secp384r1,
<                                 X25519MLKEM768,
---
>                                 ECDSA_NISTP384_SHA384,
>                                 ECDSA_NISTP256_SHA256,
>                                 ECDSA_NISTP521_SHA512,
>                                 ED25519,
>                                 RSA_PSS_SHA512,
>                                 RSA_PSS_SHA384,
>                                 RSA_PSS_SHA256,
>                                 RSA_PKCS1_SHA512,
>                                 RSA_PKCS1_SHA384,
>                                 RSA_PKCS1_SHA256,
56a70
>                         ExtendedMasterSecretRequest,
62,65c76
<                         SignatureAlgorithms(
<                             [],
<                         ),
<                         PresharedKeyModes(
---
>                         NamedGroups(
67c78,81
<                                 PSK_DHE_KE,
---
>                                 X25519,
>                                 secp256r1,
>                                 secp384r1,
>                                 X25519MLKEM768,
78c92
<                         KeyShare(
---
>                         PresharedKeyModes(
80,83c94
<                                 KeyShareEntry {
<                                     group: X25519,
<                                     payload: 7fc9067623fa270beb8df1c1bc57686e3c317ca63e3d58b59ab29be6ec3dff7a,
<                                 },
---
>                                 PSK_DHE_KE,
90c101
<         encoded: 010000de0303d16c99467414251dd9198ba1356af7630e3e0e267a64469fbcb982301a2ccf25209bea9d8d79d3702947ed12577f39e96bedc01361d863ec1d2a492f4b52a300f30014130213011303c02cc02bcca9c030c02fcca800ff0100008100230000002b0005040304030300170000000a000a0008001d0017001811ec0000001900170000147374617469632e727573742d6c616e672e6f7267000b00020100000d00020000002d00020101000500050100000000003300260024001d00207fc9067623fa270beb8df1c1bc57686e3c317ca63e3d58b59ab29be6ec3dff7a,
---
>         encoded: 010000f20303eff252c8d0dcf927248e2ca2597db5107aa5c22b52bbdcd2637932d6f4c5635420c89d4319117547a38ad9563acdba70131d85b577b2438d712bf54e91a70d2d270014130213011303c02cc02bcca9c030c02fcca800ff0100009500230000003300260024001d002055702288539fca5f20219a360bb21bec8a4727c8ae2aea47108f42ecc758f15b002b00050403040303000d0016001405030403060308070806080508040601050104010000001900170000147374617469632e727573742d6c616e672e6f726700170000000b00020100000a000a0008001d0017001811ec000500050100000000002d00020101,
92c103
< }     current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
---
> }

@djc
Copy link
Contributor

djc commented Apr 25, 2025

@muja can you look at the results of dbg!(rustls_native_certs::load_native_certs()) directly? And dbg!(openssl_probe::probe())?

@muja
Copy link
Author

muja commented Apr 25, 2025

Here is the sorted diff:

❯ diff target/rustup target/my
1c1
< 2025-04-25T11:59:52.683530Z TRACE run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::client::hs: Sending ClientHello Message {
---
> [2025-04-25T14:39:52Z TRACE rustls::client::hs] Sending ClientHello Message {
9,10c9,10
<                     random: d16c99467414251dd9198ba1356af7630e3e0e267a64469fbcb982301a2ccf25,
<                     session_id: 9bea9d8d79d3702947ed12577f39e96bedc01361d863ec1d2a492f4b52a300f3,
---
>                     random: eff252c8d0dcf927248e2ca2597db5107aa5c22b52bbdcd2637932d6f4c56354,
>                     session_id: c89d4319117547a38ad9563acdba70131d85b577b2438d712bf54e91a70d2d27,
63c63,74
<                             [],
---
>                             [
>                                 ECDSA_NISTP384_SHA384,
>                                 ECDSA_NISTP256_SHA256,
>                                 ECDSA_NISTP521_SHA512,
>                                 ED25519,
>                                 RSA_PSS_SHA512,
>                                 RSA_PSS_SHA384,
>                                 RSA_PSS_SHA256,
>                                 RSA_PKCS1_SHA512,
>                                 RSA_PKCS1_SHA384,
>                                 RSA_PKCS1_SHA256,
>                             ],
82c93
<                                     payload: 7fc9067623fa270beb8df1c1bc57686e3c317ca63e3d58b59ab29be6ec3dff7a,
---
>                                     payload: 55702288539fca5f20219a360bb21bec8a4727c8ae2aea47108f42ecc758f15b,
85,86c96
<                         ),
<                     ],
---
>                         ),                    ],
90c100
<         encoded: 010000de0303d16c99467414251dd9198ba1356af7630e3e0e267a64469fbcb982301a2ccf25209bea9d8d79d3702947ed12577f39e96bedc01361d863ec1d2a492f4b52a300f30014130213011303c02cc02bcca9c030c02fcca800ff0100008100230000002b0005040304030300170000000a000a0008001d0017001811ec0000001900170000147374617469632e727573742d6c616e672e6f7267000b00020100000d00020000002d00020101000500050100000000003300260024001d00207fc9067623fa270beb8df1c1bc57686e3c317ca63e3d58b59ab29be6ec3dff7a,
---
>         encoded: 010000f20303eff252c8d0dcf927248e2ca2597db5107aa5c22b52bbdcd2637932d6f4c5635420c89d4319117547a38ad9563acdba70131d85b577b2438d712bf54e91a70d2d270014130213011303c02cc02bcca9c030c02fcca800ff0100009500230000003300260024001d002055702288539fca5f20219a360bb21bec8a4727c8ae2aea47108f42ecc758f15b002b00050403040303000d0016001405030403060308070806080508040601050104010000001900170000147374617469632e727573742d6c616e672e6f726700170000000b00020100000a000a0008001d0017001811ec000500050100000000002d00020101,
92c102
< }     current_dir="/tmp/tmp.pG4aiqSug8/rustup" args="[\"./rustup\", \"install\", \"beta\"]" profile="Default" prefix="/home/user/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
---
> }

@muja
Copy link
Author

muja commented Apr 25, 2025

my program prints a LOT, rustup:

[src/bin/rustup-init.rs:43:1] rustls_native_certs::load_native_certs() = CertificateResult {
    certs: [],
    errors: [],
}

@djc
Copy link
Contributor

djc commented Apr 25, 2025

So there's a difference between the rustup environment and your program's environment? Is there some Fedora seccomp thing or /etc/env.d/ thing trying to restrict it?

@muja
Copy link
Author

muja commented Apr 25, 2025

I have no idea what this would be, but I've gotten a bit closer to whatever the problem is...

When I do cargo run I get the full list of certificates in my program.

When I do cargo build and run the binary directly via ./target/debug/foo, I get an empty list... WTH?

@djc
Copy link
Contributor

djc commented Apr 25, 2025

As mentioned previously, try looking at the output of openssl_probe::probe() for both of those scenarios?

@ctz
Copy link
Contributor

ctz commented Apr 25, 2025

From the earlier curl logs:

*  CAfile: /etc/pki/tls/certs/ca-bundle.crt
*  CApath: /var/run/secrets/kubernetes.io/serviceaccount

Seems odd -- do you have SSL_CERT_DIR set to that? But it seems to work I suppose.

When I do cargo run I get the full list of certificates in my program.

When I do cargo build and run the binary directly via ./target/debug/foo, I get an empty list... WTH?

This sounds like rust-lang/cargo#3676

@complexspaces
Copy link

rustls-platform-verifier 0.5.2 has been released which should help make this problem easier to diagnose further by fixing the empty signature algorithm list.

@ctz
Copy link
Contributor

ctz commented Apr 25, 2025

rustls-platform-verifier 0.5.2 has been released which should help make this problem easier to diagnose further by fixing the empty signature algorithm list.

Confirmed that works locally for me.

Before fix
$ RUSTUP_LOG=trace SSL_CERT_DIR=/not-exist SSL_CERT_FILE=/tmp/not-exist ./target/debug/rustup toolchain install beta
2025-04-25T17:30:31.236502Z DEBUG run_rustup:run_rustup_inner:main:set_globals: rustup::cli::common: read metadata version: '12' current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" current_dir="/home/jbp/src/rustup" quiet=false
2025-04-25T17:30:31.239977Z DEBUG run_rustup:run_rustup_inner:main:install:install: rustup::cli::common: installing toolchain 'beta-x86_64-unknown-linux-gnu' current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]"
2025-04-25T17:30:31.240002Z DEBUG run_rustup:run_rustup_inner:main:install:install: rustup::cli::common: toolchain directory: '/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu' current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]"
2025-04-25T17:30:31.240111Z  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' current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:30:31.240286Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::cli::common: creating temp file: /home/jbp/.rustup/tmp/b5ldvm52374yjqmn_file current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:30:31.240378Z 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' current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:30:31.240396Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::cli::common: downloading with reqwest current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:30:31.240838Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: reqwest::connect: starting new connection: https://static.rust-lang.org/     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:30:31.240916Z TRACE run_rustup:run_rustup_inner:main:install:install:update_from_dist: hyper_util::client::legacy::connect::http: Http::connect; scheme=Some("https"), host=Some("static.rust-lang.org"), port=None current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:30:31.242067Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: hyper_util::client::legacy::connect::http: connecting to 151.101.190.137:443 current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:30:31.266972Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: hyper_util::client::legacy::connect::http: connected to 151.101.190.137:443 current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:30:31.267354Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::client::hs: No cached session for DnsName("static.rust-lang.org")     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:30:31.268083Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::client::hs: Not resuming any session     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:30:31.268234Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::webpki::anchors: add_parsable_certificates processed 0 valid and 0 invalid certs     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:30:31.268278Z  WARN run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls_platform_verifier::verification::others: Error loading CA root certificate: failed to read PEM from file: No such file or directory (os error 2) at '/tmp/not-exist'     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:30:31.268299Z  WARN run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls_platform_verifier::verification::others: Error loading CA root certificate: opening directory: No such file or directory (os error 2) at '/not-exist'     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:30:31.268369Z TRACE run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::client::hs: Sending ClientHello Message {
    version: TLSv1_0,
    payload: Handshake {
        parsed: HandshakeMessagePayload {
            typ: ClientHello,
            payload: ClientHello(
                ClientHelloPayload {
                    client_version: TLSv1_2,
                    random: 7f4310fc2ee1614b404c3c2c77e7035c091140a24837efe2af3c917987388080,
                    session_id: f5e02b4ab071785a3d12f494f53f6c67f3541af3da0e8a25ac9d7bd1c622fe38,
                    cipher_suites: [
                        TLS13_AES_256_GCM_SHA384,
                        TLS13_AES_128_GCM_SHA256,
                        TLS13_CHACHA20_POLY1305_SHA256,
                        TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
                        TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
                        TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
                        TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
                        TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
                        TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
                        TLS_EMPTY_RENEGOTIATION_INFO_SCSV,
                    ],
                    compression_methods: [
                        Null,
                    ],
                    extensions: [
                        ServerName(
                            [
                                ServerName {
                                    typ: HostName,
                                    payload: HostName(
                                        DnsName(
                                            "static.rust-lang.org",
                                        ),
                                    ),
                                },
                            ],
                        ),
                        EcPointFormats(
                            [
                                Uncompressed,
                            ],
                        ),
                        CertificateStatusRequest(
                            Ocsp(
                                OcspCertificateStatusRequest {
                                    responder_ids: [],
                                    extensions: ,
                                },
                            ),
                        ),
                        SupportedVersions(
                            [
                                TLSv1_3,
                                TLSv1_2,
                            ],
                        ),
                        KeyShare(
                            [
                                KeyShareEntry {
                                    group: X25519MLKEM768,
                                    payload: 6ab276fc14b3326ca4c513a26959abefa93b4fe2c2b3c3065f6b66f2199dd399c71dfa6c8ccba676d3720e38bffc45809ae8bd3b64c7c1359a50026d6b53b514d57d6f3ab0c9e233ef661e83541defe41a61e711bac1902d65a676c481d8f5a53b06a4633a79fac609ec3b7a92f1cb90a3a25b8a4adcb3aee3300ef50a3e7c472bf6187edc35170672a16b62c6423397d9558d70f841cb46ad50cc78a15b6a6357b201d6243f41539147a2daec3e1211ab41787992d195537a8114163fe3079800607b13197eb70924c847025d808fbbcb9a147193e856bd860063b7ca437ee06d39d4afd0b652471a50a924a1579b23a04044e7d4471c0b86364b970bf4409c0bba4b9abb4abc169fdc749c495055cac767280169599e74b0a2084465b6eaa2c6e08367bc3a93047b0d3586455617998604ba41ae52314d2631a639b12c1339c3a7f789acb4111729ca2be862e10707d5b58ec0c42c10789ef7052ba109a428cc8a6f201475c2a0b76ac766f995245ca3fb5c47db634f4d605a8447c5ce517aadf70a737c9c63a82de8d830bc3129b13129a1c689e5871e0420a9179485fecc5a9f903f4ee4a5b6c08d45362b37d892291b4f272b62be79c6717844ca1213aa8a5488d834d9e2321c1a73575742d39452465b63b8641add634a51dbcfd4a39af5ec5d12e60538816c7334288b2c661275c26822cd2e3c1fc59048999a98e7f5aff5355911d211809c99adf5b3172a0c9b6c9919f4c17c3a8803879b7f136c13576e1932cfa7f831fcf8ac4084275b4b5f54a3a8a3b779b2008469a2c46145556f63a3d98c14c744af6ee48344a6c3a9e00a8fb082dc92228a34cb609c4aacd497b52172ea2223ef239388275bc0f99afccb4b00fd37f6310a2c163ef9f14247f55e8092815e98975a8250c0c5aa2743ae1848b2604b3e20a17c9cdbc091f6648fb42973ca56dfc875cc46713e908f5991574b3c71b1278aca88a4b3d556a03965fe9b9537db3c61393a91f38dfcf9bfc3e9cf36379ea5c12c0a2bb1eda01c716abfba3124ceb4b2ead114eeb706636b1dc0595a0c888ee376af5f630fade16402c98b4635934cc51d8ed171b48694eaf775fc789e155557aee64b03797628c04609a7896ee52b6a654b163b57e9b1b763f55804f0c5cfcb015ff21d75207c53630c7a0057bc487d4b572d10417d67c51b3b62c2071a01fadcb7d9673114ab446832acfd7363a49009949a8eafa3becbe4465086904da63417391458ca363363cc439cbc5267221182379ff6a09505875c1c146505408ff2426460920a7a99447ab72a41bb742a1ee3b11056969be6a3c0d3d18af8777b04473e2a58ce9ee19e0e62a3fbe908a9a1289746a42537c1ba6495ba245547bb51670701cc03b1fee5ac62a478ce3538721869ee27520450bad3d579e22a77b9fc727ba64edb001bab3228be4215233c27a7346c60d1417191aab54018fd78b9108748385074072ca7aa1a4db042984aca604384a4089c80fe9a12466634169baeffdc24732bb486a84690aa46359a5e85b28ef2741b4f28a2de6b48b8a330013b1c30137201e9356b637580baa2b8c058178b0cc91caf42677dfa010b87e0628cb54fd066ca4c44b81afb644ceb6279567394a0452f0d3c4560de6a2306713eb512773f3164a75690c9c9528693c42d109b50ad152cb383965af88b12a148b7b10760bfbfb1872533,
                                },
                                KeyShareEntry {
                                    group: X25519,
                                    payload: c9c9528693c42d109b50ad152cb383965af88b12a148b7b10760bfbfb1872533,
                                },
                            ],
                        ),
                        SignatureAlgorithms(
                            [],
                        ),
                        PresharedKeyModes(
                            [
                                PSK_DHE_KE,
                            ],
                        ),
                        ExtendedMasterSecretRequest,
                        SessionTicket(
                            Request,
                        ),
                        NamedGroups(
                            [
                                X25519MLKEM768,
                                X25519,
                                secp256r1,
                                secp384r1,
                            ],
                        ),
                    ],
                },
            ),
        },
        encoded: 010005a203037f4310fc2ee1614b404c3c2c77e7035c091140a24837efe2af3c91798738808020f5e02b4ab071785a3d12f494f53f6c67f3541af3da0e8a25ac9d7bd1c622fe380014130213011303c02cc02bcca9c030c02fcca800ff010005450000001900170000147374617469632e727573742d6c616e672e6f7267000b00020100000500050100000000002b00050403040303003304ea04e811ec04c06ab276fc14b3326ca4c513a26959abefa93b4fe2c2b3c3065f6b66f2199dd399c71dfa6c8ccba676d3720e38bffc45809ae8bd3b64c7c1359a50026d6b53b514d57d6f3ab0c9e233ef661e83541defe41a61e711bac1902d65a676c481d8f5a53b06a4633a79fac609ec3b7a92f1cb90a3a25b8a4adcb3aee3300ef50a3e7c472bf6187edc35170672a16b62c6423397d9558d70f841cb46ad50cc78a15b6a6357b201d6243f41539147a2daec3e1211ab41787992d195537a8114163fe3079800607b13197eb70924c847025d808fbbcb9a147193e856bd860063b7ca437ee06d39d4afd0b652471a50a924a1579b23a04044e7d4471c0b86364b970bf4409c0bba4b9abb4abc169fdc749c495055cac767280169599e74b0a2084465b6eaa2c6e08367bc3a93047b0d3586455617998604ba41ae52314d2631a639b12c1339c3a7f789acb4111729ca2be862e10707d5b58ec0c42c10789ef7052ba109a428cc8a6f201475c2a0b76ac766f995245ca3fb5c47db634f4d605a8447c5ce517aadf70a737c9c63a82de8d830bc3129b13129a1c689e5871e0420a9179485fecc5a9f903f4ee4a5b6c08d45362b37d892291b4f272b62be79c6717844ca1213aa8a5488d834d9e2321c1a73575742d39452465b63b8641add634a51dbcfd4a39af5ec5d12e60538816c7334288b2c661275c26822cd2e3c1fc59048999a98e7f5aff5355911d211809c99adf5b3172a0c9b6c9919f4c17c3a8803879b7f136c13576e1932cfa7f831fcf8ac4084275b4b5f54a3a8a3b779b2008469a2c46145556f63a3d98c14c744af6ee48344a6c3a9e00a8fb082dc92228a34cb609c4aacd497b52172ea2223ef239388275bc0f99afccb4b00fd37f6310a2c163ef9f14247f55e8092815e98975a8250c0c5aa2743ae1848b2604b3e20a17c9cdbc091f6648fb42973ca56dfc875cc46713e908f5991574b3c71b1278aca88a4b3d556a03965fe9b9537db3c61393a91f38dfcf9bfc3e9cf36379ea5c12c0a2bb1eda01c716abfba3124ceb4b2ead114eeb706636b1dc0595a0c888ee376af5f630fade16402c98b4635934cc51d8ed171b48694eaf775fc789e155557aee64b03797628c04609a7896ee52b6a654b163b57e9b1b763f55804f0c5cfcb015ff21d75207c53630c7a0057bc487d4b572d10417d67c51b3b62c2071a01fadcb7d9673114ab446832acfd7363a49009949a8eafa3becbe4465086904da63417391458ca363363cc439cbc5267221182379ff6a09505875c1c146505408ff2426460920a7a99447ab72a41bb742a1ee3b11056969be6a3c0d3d18af8777b04473e2a58ce9ee19e0e62a3fbe908a9a1289746a42537c1ba6495ba245547bb51670701cc03b1fee5ac62a478ce3538721869ee27520450bad3d579e22a77b9fc727ba64edb001bab3228be4215233c27a7346c60d1417191aab54018fd78b9108748385074072ca7aa1a4db042984aca604384a4089c80fe9a12466634169baeffdc24732bb486a84690aa46359a5e85b28ef2741b4f28a2de6b48b8a330013b1c30137201e9356b637580baa2b8c058178b0cc91caf42677dfa010b87e0628cb54fd066ca4c44b81afb644ceb6279567394a0452f0d3c4560de6a2306713eb512773f3164a75690c9c9528693c42d109b50ad152cb383965af88b12a148b7b10760bfbfb1872533001d0020c9c9528693c42d109b50ad152cb383965af88b12a148b7b10760bfbfb1872533000d00020000002d000201010017000000230000000a000a000811ec001d00170018,
    },
}     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:30:31.283250Z ERROR run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::download::reqwest_be: failed to download file error=Reqwest(reqwest::Error { kind: Request, url: "https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256", source: hyper_util::client::legacy::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: AlertReceived(DecodeError) } }) }) current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:30:31.283426Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::cli::common: removing toolchain directory: '/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu' current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:30:31.283473Z 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/jbp/.rustup/tmp/b5ldvm52374yjqmn_file' current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:30:31.283528Z 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/jbp/.rustup/tmp/b5ldvm52374yjqmn_file' current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]"
2025-04-25T17:30:31.283561Z 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/jbp/.rustup/tmp/b5ldvm52374yjqmn_file' current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]"
2025-04-25T17:30:31.283613Z 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/jbp/.rustup/tmp/b5ldvm52374yjqmn_file'
2025-04-25T17:30:31.283660Z ERROR rustup::cli::common: could not download file from 'https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256' to '/home/jbp/.rustup/tmp/b5ldvm52374yjqmn_file': error downloading file: error sending request for url (https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256): client error (Connect): received fatal alert: DecodeError


After fix
$ RUSTUP_LOG=trace SSL_CERT_DIR=/not-exist SSL_CERT_FILE=/tmp/not-exist ./target/debug/rustup toolchain install beta
2025-04-25T17:32:35.992724Z DEBUG run_rustup:run_rustup_inner:main:set_globals: rustup::cli::common: read metadata version: '12' current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" current_dir="/home/jbp/src/rustup" quiet=false
2025-04-25T17:32:35.996669Z DEBUG run_rustup:run_rustup_inner:main:install:install: rustup::cli::common: installing toolchain 'beta-x86_64-unknown-linux-gnu' current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]"
2025-04-25T17:32:35.996711Z DEBUG run_rustup:run_rustup_inner:main:install:install: rustup::cli::common: toolchain directory: '/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu' current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]"
2025-04-25T17:32:35.996791Z  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' current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:35.996931Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::cli::common: creating temp file: /home/jbp/.rustup/tmp/baojn1sbi4zw38c6_file current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:35.996996Z 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' current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:35.997010Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::cli::common: downloading with reqwest current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:35.997328Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: reqwest::connect: starting new connection: https://static.rust-lang.org/     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:35.997415Z TRACE run_rustup:run_rustup_inner:main:install:install:update_from_dist: hyper_util::client::legacy::connect::http: Http::connect; scheme=Some("https"), host=Some("static.rust-lang.org"), port=None current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.012974Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: hyper_util::client::legacy::connect::http: connecting to 151.101.190.137:443 current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.025538Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: hyper_util::client::legacy::connect::http: connected to 151.101.190.137:443 current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.025662Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::client::hs: No cached session for DnsName("static.rust-lang.org")     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.025798Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::client::hs: Not resuming any session     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.025881Z TRACE run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::client::hs: Sending ClientHello Message {
    version: TLSv1_0,
    payload: Handshake {
        parsed: HandshakeMessagePayload {
            typ: ClientHello,
            payload: ClientHello(
                ClientHelloPayload {
                    client_version: TLSv1_2,
                    random: 2ee61d66d659db859b27db9a5e46e1dfa466aad214264da9b08fdff14fdc52bf,
                    session_id: e165ada31dd5e4f4705f518e5400c16f4719f40c85bc6ed0aa434c13d2ba7522,
                    cipher_suites: [
                        TLS13_AES_256_GCM_SHA384,
                        TLS13_AES_128_GCM_SHA256,
                        TLS13_CHACHA20_POLY1305_SHA256,
                        TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
                        TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
                        TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
                        TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
                        TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
                        TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
                        TLS_EMPTY_RENEGOTIATION_INFO_SCSV,
                    ],
                    compression_methods: [
                        Null,
                    ],
                    extensions: [
                        CertificateStatusRequest(
                            Ocsp(
                                OcspCertificateStatusRequest {
                                    responder_ids: [],
                                    extensions: ,
                                },
                            ),
                        ),
                        SessionTicket(
                            Request,
                        ),
                        EcPointFormats(
                            [
                                Uncompressed,
                            ],
                        ),
                        ServerName(
                            [
                                ServerName {
                                    typ: HostName,
                                    payload: HostName(
                                        DnsName(
                                            "static.rust-lang.org",
                                        ),
                                    ),
                                },
                            ],
                        ),
                        PresharedKeyModes(
                            [
                                PSK_DHE_KE,
                            ],
                        ),
                        ExtendedMasterSecretRequest,
                        SignatureAlgorithms(
                            [
                                ECDSA_NISTP384_SHA384,
                                ECDSA_NISTP256_SHA256,
                                ECDSA_NISTP521_SHA512,
                                ED25519,
                                RSA_PSS_SHA512,
                                RSA_PSS_SHA384,
                                RSA_PSS_SHA256,
                                RSA_PKCS1_SHA512,
                                RSA_PKCS1_SHA384,
                                RSA_PKCS1_SHA256,
                            ],
                        ),
                        SupportedVersions(
                            [
                                TLSv1_3,
                                TLSv1_2,
                            ],
                        ),
                        NamedGroups(
                            [
                                X25519,
                                secp256r1,
                                secp384r1,
                                X25519MLKEM768,
                            ],
                        ),
                        KeyShare(
                            [
                                KeyShareEntry {
                                    group: X25519,
                                    payload: a933b893e0a7043e8f021d92241bb75fe6e918f37063711461e5ef9fbb48ba13,
                                },
                            ],
                        ),
                    ],
                },
            ),
        },
        encoded: 010000f203032ee61d66d659db859b27db9a5e46e1dfa466aad214264da9b08fdff14fdc52bf20e165ada31dd5e4f4705f518e5400c16f4719f40c85bc6ed0aa434c13d2ba75220014130213011303c02cc02bcca9c030c02fcca800ff0100009500050005010000000000230000000b000201000000001900170000147374617469632e727573742d6c616e672e6f7267002d0002010100170000000d001600140503040306030807080608050804060105010401002b00050403040303000a000a0008001d0017001811ec003300260024001d0020a933b893e0a7043e8f021d92241bb75fe6e918f37063711461e5ef9fbb48ba13,
    },
}     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.041993Z TRACE run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::client::hs: We got ServerHello ServerHelloPayload {
    extensions: [
        SupportedVersions(
            TLSv1_3,
        ),
        KeyShare(
            KeyShareEntry {
                group: X25519,
                payload: e83df5f546d683597f637042db2178782e9312fd5f5a61e715bbe4277dc91e4d,
            },
        ),
    ],
    legacy_version: TLSv1_2,
    random: f14e2adfab1e7ba112fb20864b4ae87b2ac835d12107c5d3da5afe56c3070277,
    session_id: e165ada31dd5e4f4705f518e5400c16f4719f40c85bc6ed0aa434c13d2ba7522,
    cipher_suite: TLS13_AES_128_GCM_SHA256,
    compression_method: Null,
}     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.042152Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::client::hs: Using ciphersuite TLS13_AES_128_GCM_SHA256     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.042210Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::client::tls13: Not resuming     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.042236Z TRACE run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::client::client_conn: EarlyData rejected     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.042424Z TRACE run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::conn: Dropping CCS     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.042480Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::client::tls13: TLS1.3 encrypted extensions: [ServerNameAck]     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.042505Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::client::hs: ALPN protocol is None     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.046623Z TRACE run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::client::tls13: Server cert is CertificateChain([CertificateDer(0x3082068f30820577a003020102021001d143c50cf53f77003d46ee64b1d626300d06092a864886f70d01010b05003058310b300906035504061302424531193017060355040a1310476c6f62616c5369676e206e762d7361312e302c06035504031325476c6f62616c5369676e2041746c617320523320445620544c532043412032303234205134301e170d3234313230383039353131325a170d3236303130393039353131315a30263124302206035504030c1b666173746c792d7374617469632e727573742d6c616e672e6f726730820122300d06092a864886f70d01010105000382010f003082010a0282010100d8eff495945c0c049b9a97827ef0e5d8b74f8b4e3fb6ad846c4780f3d443f110c5dac1fc8188cf62f9ba358092765f1edcca54f2092e6d5a6395fe8ed4c2d3723f9cd97ebeac3a0f582cfeb409a08c1f4a98721f73e5183ef9d782793fac84a2cfaab6bdfe6745b23ad72caa71e128d2852a603da5dc016e94f63dac14c2df34565ef8a17dc2a1dd5f03d412145ae7bfae019e9fb3a6e93958ea4daecb9aae2617e2ecc0950b28d9a90e664a2c4c183ab9ac5ce8cfb0a4022fb58c331a2b968f4273fce104d178bc20c117b6101dfed4d6c99b50732b91109171e889be4ded49b8f5aff85a77179dcec3b78c050189444a64ce3e184a063a8bbe4536649dc3410203010001a382038530820381303c0603551d1104353033821b666173746c792d7374617469632e727573742d6c616e672e6f726782147374617469632e727573742d6c616e672e6f7267300e0603551d0f0101ff0404030205a0301d0603551d250416301406082b0601050507030106082b06010505070302301d0603551d0e04160414a046ea9cf50b83d0f6c4a1d2124acd25a85d053b30570603551d200450304e3008060667810c0102013042060a2b06010401a0320a01033034303206082b06010505070201162668747470733a2f2f7777772e676c6f62616c7369676e2e636f6d2f7265706f7369746f72792f300c0603551d130101ff0402300030819e06082b0601050507010104819130818e304006082b060105050730018634687474703a2f2f6f6373702e676c6f62616c7369676e2e636f6d2f63612f677361746c617372336476746c736361323032347134304a06082b06010505073002863e687474703a2f2f7365637572652e676c6f62616c7369676e2e636f6d2f6361636572742f677361746c617372336476746c7363613230323471342e637274301f0603551d230418301680146091ec1c02f20efe634f65cb62b0022a0358e9b330480603551d1f0441303f303da03ba0398637687474703a2f2f63726c2e676c6f62616c7369676e2e636f6d2f63612f677361746c617372336476746c7363613230323471342e63726c3082017e060a2b06010401d6790204020482016e0482016a01680076001986d4c728aa6ffeba036f782a4d0191aace2d72310faece5d70412d254cc7d400000193a5ae21950000040300473045022073268330d67befc56c35483bccdc00b2be46c8a1e29280387f868add0a452827022100a22e0c0280859b2fe31fb607471ae31cbeb8db3c896e56daa2fd3e43bf25f8850076000e5794bcf3aea93e331b2c9907b3f790df9bc23d713225dd21a925ac61c54e2100000193a5ae2183000004030047304502200255d25493fabeaf43a841d09b1a5fcf9d812b8ad70e53a49646a5e0ea436fae022100d44e18bfdc08580e830529ad1f259364e8bd81d003015301746cc6eb17decbfa007600cb38f715897c84a1445f5bc1ddfbc96ef29a59cd470a690585b0cb14c31458e700000193a5ae223a0000040300473045022013faabb49fc0aec0f8faebeecb625819a93490a1c2c2a806b9a77d290ab2bbc1022100ba89f1367d4a643c0f68d1215521d8e76ac307f1fbdbd9836a18f43648da1377300d06092a864886f70d01010b0500038201010025e5ff061e349c7c4b515dae68e170aac746154a5ebdb4788c8738229dafc4fd605812e3c695ce64ce755082f347c9e1aa32bbe88a2b540ab72c165ad021fc57b70d49709209d69d10472a709face4d00c6a9b72453c055fae5a0c81e34c8b9edb882ca595ab4334472ab233606223c24fad49bca762af7a46f27a3ac0a8d04fdb6b878be51a94e7107263c953c8fa2108e1ac98750cd36f15e370ab41a816b350c118c0203243e3906e94b6d348cec9b010ba037fcbea11536b1d06218ec5d4b1e07b6c33093260edef49755afabc67324b741cce6d12aa824b0b8d5a055eb25f6a2b28ab1dbb7f6e048a850ed7cc8b3933be7ae5f095e6b32b02ef6882b63e), CertificateDer(0x3082049030820378a003020102021100817cd51426f2ddf6ff588022c88554f6300d06092a864886f70d01010b0500304c3120301e060355040b1317476c6f62616c5369676e20526f6f74204341202d20523331133011060355040a130a476c6f62616c5369676e311330110603550403130a476c6f62616c5369676e301e170d3234303731373033303934305a170d3236303731373030303030305a3058310b300906035504061302424531193017060355040a1310476c6f62616c5369676e206e762d7361312e302c06035504031325476c6f62616c5369676e2041746c617320523320445620544c53204341203230323420513430820122300d06092a864886f70d01010105000382010f003082010a0282010100e09126c46259dbe4fff2647f0c6ac5dc818e9051c9ff619efaa92b4b065d8abfd6510bc641d815cdec23ce2ca2dc55b983d365e7fe2882d77139afb3648d3afa687c30e0586d879897135207f517b64472c00ecd25703cd654a6ab0d2f811bc5b6c7e819ecd919559c0e42ca0b1f8c36c24409771d180770f47ea09d896e0a98e924d3fbb2a06e7f19b10d271b7896c4b2b077f09b004fef130f738971c2ecf9132ccd40c485d1472486a1407e110e157f5b38db3adcea74edc8d9dc20514398b80c2c139d2174101f58b5eebde199e52b55b36a3f344e16ca27f946abe357bf756c491c697ffcb28e9ae1bb1fc6ced2c8fa757de70f978c213b5cd755a4ba430203010001a382015f3082015b300e0603551d0f0101ff040403020186301d0603551d250416301406082b0601050507030106082b0601050507030230120603551d130101ff040830060101ff020100301d0603551d0e041604146091ec1c02f20efe634f65cb62b0022a0358e9b3301f0603551d230418301680148ff04b7fa82e4524ae4d50fa639a8bdee2dd1bbc307b06082b06010505070101046f306d302e06082b060105050730018622687474703a2f2f6f637370322e676c6f62616c7369676e2e636f6d2f726f6f747233303b06082b06010505073002862f687474703a2f2f7365637572652e676c6f62616c7369676e2e636f6d2f6361636572742f726f6f742d72332e63727430360603551d1f042f302d302ba029a0278625687474703a2f2f63726c2e676c6f62616c7369676e2e636f6d2f726f6f742d72332e63726c30210603551d20041a30183008060667810c010201300c060a2b06010401a0320a0103300d06092a864886f70d01010b050003820101003dca13a1ecd766a15447c8ba0043c1b400d4ef4b7ff64e62e866288fe8e7018413844b49ee26105211a45f9b9a10a2a416aeee50cf80c2cc25bd9dc091141d58be9d4937eb2ec1f4b727338099af471869ae0fb13919b6900d7e42daff7e548ad93da7e9e672be8a3f4bfb094e3226edb319ac0ad5331f784926cb1c4f57d74408833b862bb9beb215268d471794cdc0e0caa559cf21401530691d2bc07831d6ddd4556392142533011449c976680b2fea38b52be8f93303ef4d4fda23924ea081f23179eae53c000a5026671cd9d981d8d9f47fa0bff9f50cbc53e45a06a80adbf55ff7723014cc8f3fcdfabf612a2440f9c9a23051be392a33fb7acd42f34f)])     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.046876Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls::webpki::anchors: add_parsable_certificates processed 0 valid and 0 invalid certs     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.046897Z  WARN run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls_platform_verifier::verification::others: Error loading CA root certificate: failed to read PEM from file: No such file or directory (os error 2) at '/tmp/not-exist'     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.046920Z  WARN run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustls_platform_verifier::verification::others: Error loading CA root certificate: opening directory: No such file or directory (os error 2) at '/not-exist'     current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.047118Z ERROR run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::download::reqwest_be: failed to download file error=Reqwest(reqwest::Error { kind: Request, url: "https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256", source: hyper_util::client::legacy::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: General("No CA certificates were loaded from the system") } }) }) current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.047283Z DEBUG run_rustup:run_rustup_inner:main:install:install:update_from_dist: rustup::cli::common: removing toolchain directory: '/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu' current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.047323Z 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/jbp/.rustup/tmp/baojn1sbi4zw38c6_file' current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]" profile="Default" prefix="/home/jbp/.rustup/toolchains/beta-x86_64-unknown-linux-gnu"
2025-04-25T17:32:36.047374Z 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/jbp/.rustup/tmp/baojn1sbi4zw38c6_file' current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]"
2025-04-25T17:32:36.047398Z 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/jbp/.rustup/tmp/baojn1sbi4zw38c6_file' current_dir="/home/jbp/src/rustup" args="[\"./target/debug/rustup\", \"toolchain\", \"install\", \"beta\"]"
2025-04-25T17:32:36.047444Z 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/jbp/.rustup/tmp/baojn1sbi4zw38c6_file'
2025-04-25T17:32:36.047489Z ERROR rustup::cli::common: could not download file from 'https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256' to '/home/jbp/.rustup/tmp/baojn1sbi4zw38c6_file': error downloading file: error sending request for url (https://static.rust-lang.org/dist/channel-rust-beta.toml.sha256): client error (Connect): unexpected error: No CA certificates were loaded from the system

@muja
Copy link
Author

muja commented Apr 25, 2025

Sorry I had to leave for a bit, so yes rust-lang/cargo#3676 was hitting me in this case, I do not have a SSL_CERT_FILE environment variable in my shell, however when using cargo run it is passed to the program which leads to the successful fetch. Although I am left wondering:

  • why is cargo smarter than [whatever machinery rustup is using] in determining and setting the SSL_CERT_FILE, similar to every other tool like curl etc?
  • Shouldn't the system certificates (via update-ca-certificates etc) be trusted, regardless of the SSL_CERT_FILE?

@muja
Copy link
Author

muja commented Apr 25, 2025

From the earlier curl logs:

*  CAfile: /etc/pki/tls/certs/ca-bundle.crt
*  CApath: /var/run/secrets/kubernetes.io/serviceaccount

Seems odd -- do you have SSL_CERT_DIR set to that? But it seems to work I suppose.

Yes, I have this set (but no SSL_CERT_FILE):

❯ env | grep SSL_
SSL_CERT_DIR=/var/run/secrets/kubernetes.io/serviceaccount

And in the cargo run case, SSL_CERT_FILE is being set to /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem

EDIT: and just to verify, there is no other environment variable pointing to a ca-bundle apart from these:

❯ env | grep -E '.crt|.pem|/etc/pki|ca-bundle'
NODE_EXTRA_CA_CERTS=/tmp/node-extra-certificates/ca.crt
AWS_CA_BUNDLE=/etc/ssl/cert.pem

@ctz
Copy link
Contributor

ctz commented Apr 25, 2025

Sorry I had to leave for a bit, so yes rust-lang/cargo#3676 was hitting me in this case, I do not have a SSL_CERT_FILE environment variable in my shell, however when using cargo run it is passed to the program which leads to the successful fetch. Although I am left wondering:

  • why is cargo smarter than [whatever machinery rustup is using] in determining and setting the SSL_CERT_FILE, similar to every other tool like curl etc?

For this, cargo uses the host openssl installation, which will have been customised by your distribution to know the most accurate location. That is good. But that cargo sets the environment variables at all is a mistake.

  • Shouldn't the system certificates (via update-ca-certificates etc) be trusted, regardless of the SSL_CERT_FILE?

No. The SSL_CERT_FILE and SSL_CERT_DIR environment variables are overrides, and should prevent any other locations being consulted.

Yes, I have this set (but no SSL_CERT_FILE):

❯ env | grep SSL_
SSL_CERT_DIR=/var/run/secrets/kubernetes.io/serviceaccount

Why is that? Does it point to a directory full of openssl rehash-style certificate files?

And in the cargo run case, SSL_CERT_FILE is being set to /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem

Could you run this?

#!/usr/bin/env -S cargo +nightly -Zscript

---
[dependencies]
openssl-probe = "0.1"
---

fn main() {
  let probe = openssl_probe::probe();
  dbg!(probe.cert_file);
  dbg!(probe.cert_dir);
}

And then inspect the file and directory it prints?

FWIW on ubuntu for me this gives:

[/home/jbp/.cargo/target/67/94792d3c6fed6b/hello:10:3] probe.cert_file = Some(
    "/usr/lib/ssl/cert.pem",
)
[/home/jbp/.cargo/target/67/94792d3c6fed6b/hello:11:3] probe.cert_dir = Some(
    "/usr/lib/ssl/certs",
)

The file /usr/lib/ssl/cert.pem:

$ file /usr/lib/ssl/cert.pem
/usr/lib/ssl/cert.pem: symbolic link to /etc/ssl/certs/ca-certificates.crt

$ file /etc/ssl/certs/ca-certificates.crt
/etc/ssl/certs/ca-certificates.crt: PEM certificate

The directory /usr/lib/ssl/certs:

$ ls -lha /usr/lib/ssl/certs | head
Permissions Size User Date Modified Name
lrwxrwxrwx     - root 24 Apr  2024  0a775a30.0 -> GTS_Root_R3.pem
lrwxrwxrwx     - root 24 Apr  2024  0b1b94ef.0 -> CFCA_EV_ROOT.pem
lrwxrwxrwx     - root 24 Apr  2024  0b9bc432.0 -> ISRG_Root_X2.pem
lrwxrwxrwx     - root 24 Apr  2024  0bf05006.0 -> SSL.com_Root_Certification_Authority_ECC.pem
lrwxrwxrwx     - root 24 Apr  2024  0c31d5ce.0 -> ssl-cert-snakeoil.pem
lrwxrwxrwx     - root 24 Apr  2024  0f5dc4f3.0 -> UCA_Extended_Validation_Root.pem
lrwxrwxrwx     - root 24 Apr  2024  0f6fa695.0 -> GDCA_TrustAUTH_R5_ROOT.pem
lrwxrwxrwx     - root 24 Apr  2024  002c0b4f.0 -> GlobalSign_Root_R46.pem
lrwxrwxrwx     - root 24 Apr  2024  0179095f.0 -> BJCA_Global_Root_CA1.pem

Really appreciate your patience as we get to the bottom of this!

@muja
Copy link
Author

muja commented Apr 25, 2025

Sorry I had to leave for a bit, so yes rust-lang/cargo#3676 was hitting me in this case, I do not have a SSL_CERT_FILE environment variable in my shell, however when using cargo run it is passed to the program which leads to the successful fetch. Although I am left wondering:

  • why is cargo smarter than [whatever machinery rustup is using] in determining and setting the SSL_CERT_FILE, similar to every other tool like curl etc?

For this, cargo uses the host openssl installation, which will have been customised by your distribution to know the most accurate location. That is good. But that cargo sets the environment variables at all is a mistake.

  • Shouldn't the system certificates (via update-ca-certificates etc) be trusted, regardless of the SSL_CERT_FILE?

No. The SSL_CERT_FILE and SSL_CERT_DIR environment variables are overrides, and should prevent any other locations being consulted.

Yes, I have this set (but no SSL_CERT_FILE):

❯ env | grep SSL_
SSL_CERT_DIR=/var/run/secrets/kubernetes.io/serviceaccount

Why is that? Does it point to a directory full of openssl rehash-style certificate files?

And in the cargo run case, SSL_CERT_FILE is being set to /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem

Could you run this?

#!/usr/bin/env -S cargo +nightly -Zscript

---
[dependencies]
openssl-probe = "0.1"
---

fn main() {
  let probe = openssl_probe::probe();
  dbg!(probe.cert_file);
  dbg!(probe.cert_dir);
}

And then inspect the file and directory it prints?

FWIW on ubuntu for me this gives:

[/home/jbp/.cargo/target/67/94792d3c6fed6b/hello:10:3] probe.cert_file = Some(
    "/usr/lib/ssl/cert.pem",
)
[/home/jbp/.cargo/target/67/94792d3c6fed6b/hello:11:3] probe.cert_dir = Some(
    "/usr/lib/ssl/certs",
)

The file /usr/lib/ssl/cert.pem:

$ file /usr/lib/ssl/cert.pem
/usr/lib/ssl/cert.pem: symbolic link to /etc/ssl/certs/ca-certificates.crt

$ file /etc/ssl/certs/ca-certificates.crt
/etc/ssl/certs/ca-certificates.crt: PEM certificate

The directory /usr/lib/ssl/certs:

$ ls -lha /usr/lib/ssl/certs | head
Permissions Size User Date Modified Name
lrwxrwxrwx - root 24 Apr 2024 0a775a30.0 -> GTS_Root_R3.pem
lrwxrwxrwx - root 24 Apr 2024 0b1b94ef.0 -> CFCA_EV_ROOT.pem
lrwxrwxrwx - root 24 Apr 2024 0b9bc432.0 -> ISRG_Root_X2.pem
lrwxrwxrwx - root 24 Apr 2024 0bf05006.0 -> SSL.com_Root_Certification_Authority_ECC.pem
lrwxrwxrwx - root 24 Apr 2024 0c31d5ce.0 -> ssl-cert-snakeoil.pem
lrwxrwxrwx - root 24 Apr 2024 0f5dc4f3.0 -> UCA_Extended_Validation_Root.pem
lrwxrwxrwx - root 24 Apr 2024 0f6fa695.0 -> GDCA_TrustAUTH_R5_ROOT.pem
lrwxrwxrwx - root 24 Apr 2024 002c0b4f.0 -> GlobalSign_Root_R46.pem
lrwxrwxrwx - root 24 Apr 2024 0179095f.0 -> BJCA_Global_Root_CA1.pem

Really appreciate your patience as we get to the bottom of this!

     Running `/home/user/.cargo/target/33/d94c43344f2ed9/debug/cargorun`
[/home/user/.cargo/target/33/d94c43344f2ed9/cargorun:10:3] probe.cert_file = Some(
    "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem",
)
[/home/user/.cargo/target/33/d94c43344f2ed9/cargorun:11:3] probe.cert_dir = Some(
    "/var/run/secrets/kubernetes.io/serviceaccount",
)

I believe this SSL_CERT_DIR is pointing to a directory that Kubernetes is mounting volumes from a ConfigMap:

❯ file /var/run/secrets/kubernetes.io/serviceaccount/*
/var/run/secrets/kubernetes.io/serviceaccount/ca.crt:         symbolic link to ..data/ca.crt
/var/run/secrets/kubernetes.io/serviceaccount/namespace:      symbolic link to ..data/namespace
/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt: symbolic link to ..data/service-ca.crt
/var/run/secrets/kubernetes.io/serviceaccount/token:          symbolic link to ..data/token
❯ file /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem: UTF-8 Unicode text

 ❯ wc /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem  
  5037   5907 293620 /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem

EDIT: so unsetting SSL_CERT_DIR does indeed fix the error. Same with setting SSL_CERT_FILE. The issue only occurs is if one is provided and the other is not...

@ctz
Copy link
Contributor

ctz commented Apr 25, 2025

     Running `/home/user/.cargo/target/33/d94c43344f2ed9/debug/cargorun`
[/home/user/.cargo/target/33/d94c43344f2ed9/cargorun:10:3] probe.cert_file = Some(
    "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem",
)
[/home/user/.cargo/target/33/d94c43344f2ed9/cargorun:11:3] probe.cert_dir = Some(
    "/var/run/secrets/kubernetes.io/serviceaccount",
)

UGH. I realised now I just walked you into a trap. Sorry. Even cargo script is run as a subprocess of cargo, so it is destroying your environment like cargo run did.

Could you add the openssl_probe code to your earlier test code, and run it via target/debug/foo?

I believe this SSL_CERT_DIR is pointing to a directory that Kubernetes is mounting volumes from a ConfigMap:

❯ file /var/run/secrets/kubernetes.io/serviceaccount/*
/var/run/secrets/kubernetes.io/serviceaccount/ca.crt:         symbolic link to ..data/ca.crt
/var/run/secrets/kubernetes.io/serviceaccount/namespace:      symbolic link to ..data/namespace
/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt: symbolic link to ..data/service-ca.crt
/var/run/secrets/kubernetes.io/serviceaccount/token:          symbolic link to ..data/token

Interesting. My understanding of that directory is that openssl will only read entries lazily, using file names that are hashes (like 0bf05006.0). So I think these files are going to be ignored.

@muja
Copy link
Author

muja commented Apr 25, 2025

No difference:

 ❯ cargo run
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.12s
     Running `target/debug/foo`
[src/main.rs:10:5] probe.cert_file = Some(
    "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem",
)
[src/main.rs:11:5] probe.cert_dir = Some(
    "/var/run/secrets/kubernetes.io/serviceaccount",
)

❯ ./target/debug/foo 
[src/main.rs:10:5] probe.cert_file = Some(
    "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem",
)
[src/main.rs:11:5] probe.cert_dir = Some(
    "/var/run/secrets/kubernetes.io/serviceaccount",
)

@rami3l
Copy link
Member

rami3l commented Apr 28, 2025

@djc I think this should not be a blocker of the upcoming v1.28.2 release (at least the old backends are still usable), so I'm pushing this back to v1.28.3 (or whatever comes next). Is that okay?

@djc
Copy link
Contributor

djc commented Apr 28, 2025

Seems fair. It looks like this is a pretty rare platform-specific issue anyway, and we have some mitigations/improvements already in place.

@muja
Copy link
Author

muja commented Apr 28, 2025

Really greatest and warmest thanks to you all for getting so thoroughly involved. Was some crazy investigating but now that we've gotten to the bottom of this issue, it's easy to fix on my side so the issue can be addressed later, whatever the fix may be. Diagnostics were already but could definitely be further improved in the long-term, but that is indeed a never ending battle.

Thanks!

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

No branches or pull requests

5 participants