Skip to content
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

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

Closed
zx950921 opened this issue Sep 18, 2020 · 9 comments
Closed
Labels

Comments

@zx950921
Copy link

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
Copy link
Owner

nabijaczleweli commented Sep 28, 2020

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
Copy link
Author

[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

@zx950921 zx950921 closed this as completed Oct 7, 2020
nabijaczleweli added a commit that referenced this issue Oct 9, 2020
@nabijaczleweli
Copy link
Owner

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

@zx950921
Copy link
Author

zx950921 commented Oct 10, 2020

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
Copy link
Owner

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
Copy link
Owner

Released in v4.2.0

@zx950921
Copy link
Author

zx950921 commented Dec 1, 2020

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

@nabijaczleweli
Copy link
Owner

Bump

@nabijaczleweli
Copy link
Owner

three-year bump

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

2 participants