nabijaczleweli / cargo-update

A cargo subcommand for checking and applying updates to installed executables
MIT License
1.22k stars 42 forks source link

cargo config http.proxy caused the error:malformed URL '127.0.0.1:1080' #144

Closed zx950921 closed 4 years ago

zx950921 commented 4 years ago

my cargo .cargo/config:

[http]
proxy = "127.0.0.1:1080"

[https]
proxy = "127.0.0.1:1080"

I use "cargo update" and "cargo install" to pass the proxy normally.No problem with proxy service. But when using "cargo install-update -a" an error occurs directly, the error content is

~$ cargo install-update -a
     Updating registry'https://github.com/rust-lang/crates.io-index'
Failed to update index repository: malformed URL '127.0.0.1:1080'.

rust version is:

   stable-x86_64-unknown-linux-gnu unchanged - rustc 1.46.0 (04488afe3 2020-08-24)
  nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.48.0-nightly (f3c923a13 2020-09-17)

cargo version is:cargo 1.48.0-nightly (8777a6b1e 2020-09-15)

nabijaczleweli commented 4 years ago

Hm, this is correct: "127.0.0.1:1080" is not a valid URL and libgit2 is right to reject it here. A better question is how Cargo mangles the values.

As a test, does it work if you set it to http://127.0.0.1:1080 and https://127.0.0.1:1080 instead?

zx950921 commented 4 years ago
[http]
proxy = "http://127.0.0.1:1080"

[https]
proxy = "https://127.0.0.1:1080"

I change the config file to this,it work well.

The doc of this is: doc

I didn't notice this detail before, The complete http proxy configuration should be "[protocol://]host[:port]"

Thanks for helping

nabijaczleweli commented 4 years ago

Can you install from master (at least 96551827f4a5244dd2d54e29dc8b7103e6354398) and try again with your original config? It should work now.

zx950921 commented 4 years ago

I clone this git and buid the last version,change to original config.run commod "./cargo-install-update install-update -a" get this error

$ ./cargo-install-update install-update -a
    Updating registry 'https://github.com/rust-lang/crates.io-index'
Failed to update index repository: SSL error: syscall failure: .
nabijaczleweli commented 4 years ago

Possibly related to #142? Dunno. It looks like someone really broke libssl (it might or might not be prudent to report this to your distributor) -- thanks for trying, anyway.

nabijaczleweli commented 3 years ago

Released in v4.2.0

zx950921 commented 3 years ago

Thank you, I'll try the new version as soon as possible

nabijaczleweli commented 2 years ago

Bump

nabijaczleweli commented 1 year ago

three-year bump