Rustup 1.22.0 can no longer connect to the network behind a proxy

I have updated rustup to 1.22.0.
I think the update was successful. However, after that, rustup check, rustup self update, etc. caused a network error and stopped working.
Maybe it's because my environment is behind a proxy?
In any case, it worked correctly in 1.21.1, but no longer in 1.22.0. :pensive:

Output in wsl environment (It was the same in the Windows environment)

$ rustup self update
info: checking for self-updates
error: could not download file from 'https://static.rust-lang.org/rustup/release-stable.toml' to '/tmp/rustup-updatehKAODH/release-stable.toml'
error: caused by: failed to make network request
error: caused by: error sending request for url (https://static.rust-lang.org/rustup/release-stable.toml): error trying to connect: tcp connect error: Connection refused (os error 111)
error: caused by: error trying to connect: tcp connect error: Connection refused (os error 111)
error: caused by: tcp connect error: Connection refused (os error 111)
error: caused by: Connection refused (os error 111)

I don't know if it helps but you can find rustup documentation here. It looks like you have to set the https_proxy environment variable?

@chrisd, thank you.

I have already set https_proxy.

export https_proxy=http://proxy.example.com:8080

It didn't work.
Even dropping http:// from the variable didn't help.

However, the following method worked well.

RUSTUP_USE_CURL=1 rustup update

Why... :thinking:

It's a bug which will be fixed in 1.22.1. RUSTUP_USE_CURL is a good workaround in the meantime.

2 Likes

@inejge, thank you!

I look forward to the 1.22.1 release and until then use RUST_USE_CURL as a workaround. :smiley:

@tresuke 1.22.1 has been released! A self update should get it soon or you can re-download the installer.

1 Like

After updating to 1.22.1 it works fine! :smile:

2 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.