rustup-init does not honor ~/.curlrc

Created on 8 Feb 2017  路  1Comment  路  Source: rust-lang/rustup

Hi,

rustup-init is unable to fetch data from behind my proxy:

sdass@xxxxxxx:~ > rustup-init -v -y --default-toolchain nightly
verbose: installing toolchain 'nightly-x86_64-unknown-linux-gnu'
verbose: toolchain directory: '/home/sdass/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
verbose: creating temp file: /home/sdass/.rustup/tmp/wjcua6r82_7q7p6g_file
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256'
verbose: downloading with curl
verbose: removing toolchain directory: '/home/sdass/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256' to '/home/sdass/.rustup/tmp/wjcua6r82_7q7p6g_file
info: caused by: error during download
info: caused by: [56] Failure when receiving data from the peer (Received HTTP code 407 from proxy after CONNECT)

I've already set the http_proxy variable:

sdass@xxxxxxx:~ > echo $http_proxy
http://xxxxxx.xxx.com:3128

To test I tried to get this file using curl binary - the error gave me the idea to use --insecure (-k):

sdass@xxxxxxx:~ > curl https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256
curl: (60) Peer certificate cannot be authenticated with known CA certificates
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.
sdass@xxxxxxx:~ > curl -kO https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0    92    0    92    0     0     72      0 --:--:--  0:00:01 --:--:--   115
sdass@xxxxxxx:~ > cat channel-rust-nightly.toml.sha256
af403537ce028561807aded09fb8b5e4fecffd54621ac7933df66aa73423e50c  channel-rust-nightly.toml



md5-64bf1b814a9f7953fb017029ab695621



sdass@xxxxxxx:~ > cat ~/.curlrc
insecure



md5-78840284e442da62b41d35cf6f0a93ec



sdass@xxxxxxx:~ > curl https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256
af403537ce028561807aded09fb8b5e4fecffd54621ac7933df66aa73423e50c  channel-rust-nightly.toml

However, rustup-init doesn't seem to honor ~/.curlrc and keeps returning the same error. Unfortunately I don't know of any way to pass these flags to libcurl(?) being used by rustup-init.

>All comments

Thank you for the suggestion @SoumenDass.

The rustup backend is not documented to be curl, and will not always be curl. If there are features that are needed from .curlrc, please open issues on them specifically so they can be added to rustup directly.

Was this page helpful?
0 / 5 - 0 ratings