Skip to content

rustup-init does not honor ~/.curlrc #942

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SoumenDass opened this issue Feb 8, 2017 · 1 comment
Closed

rustup-init does not honor ~/.curlrc #942

SoumenDass opened this issue Feb 8, 2017 · 1 comment

Comments

@SoumenDass
Copy link

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

Based on the curl man page, I set the -k quivalent long option in .curlrc:

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

This works when invoking the curl binary - I no longer had to specify the option:

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.

@brson
Copy link
Contributor

brson commented Mar 17, 2017

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.

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

No branches or pull requests

2 participants