-
Notifications
You must be signed in to change notification settings - Fork 936
Proxy: Cannot download files #2523
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
Comments
I would guess that this would likely be a problem in |
HI, I have the similar problem that using Here is the debug output:
Verbose Output
My current environment has these variables set
Using the
The related issues so far: |
I can't reproduce the reported behavior when running the following program: // env_proxy = "0.4"
// url = "2"
use env_proxy::for_url;
use url::Url;
fn main() {
let manifest = "https://static.rust-lang.org/rustup/release-stable.toml";
let proxy = for_url(&Url::parse(manifest).unwrap());
dbg!(proxy.to_url());
} The program mimics
and
produce the same output:
I may try with |
I have a issue when install rust and I guess it's like this problem about proxy.
And I turn off the Ubuntu's system proxy, restart and the installation script would have successed. |
@X-21 cp $(which rustup) /tmp/rustup-init
strace -f -s1024 -o /tmp/trace.log /tmp/rustup-init And then once it has failed as above, you can attach trace.log to a comment (do not paste it in, attach it please, it'll be quite big) and we can look to see if we can see what's going on. |
Sure, I am pleasure to help that.
Then it was failed as expected and generated the trace.log which I attached. |
Okay, so from the looks of that trace, it connected to your proxy and sent the clienthello etc. Your proxy then did not respond. Are you sure the https proxy is actually working? Could you also do the following for me to see how curl deals with things?
Then attach curltrace.log please? |
Yes I am sure the proxy is working. I can't visit some entertainment website without the proxy. And the curltrace.log: |
Okay, curl looks like it used HTTP not HTTPs to talk to the proxy on your system. Fascinating. If I set similar environment variables and run curl, it uses HTTPs to connect, not HTTP, same as rustup does. On the other hand, wget interestingly uses HTTP by default when it tries to use a proxy. Your curl is 7.47.0 whereas mine is 7.64.0. I wonder if this is simply the case that older versions of curl, and wget, always use http to connect to https proxies, whereas newer ones (and rustup) use https, and whatever proxying software is on that server can't cope with the choice between the two? Sadly your proxy doesn't announce itself in the 'connection established' response which makes it harder to guess. Do you know what proxy software is in use? |
I use proxy by ubuntu's Network proxy like that: so all request(http/https/socks5/ftp) will be transmitted to another machine in local network, and this machine will handle these request to a proxy software named shadowsocks what is a proxy work in Transport Layer. I try curl https://www.google.com and capture it: |
and I capture it when download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' : |
The SNI is not relevant here, it's that we're doing SSL to the proxy, which the proxy is not responding to properly. Is the machine |
Yes I know it was doing SSL to proxy, but I think it should do SSL to static.rust-lang.org via shadowsocks. |
I agree that it should do SSL to static.rust-lang.org. It would achieve that by establishing the link to the proxy and then asking it to connect through to port 443 on static.rust-lang.org and then it'd establish SSL over that. Having read through shadowsocks' code, it uses privoxy as its underlying http proxy. Having been through privoxy's source code it has no SSL capability at all. Given that, your https_proxy environment variable should be set to I'd suggest not setting it in the https proxy slot, clients should fall back to http_proxy from there IIRC. |
I also added a strace log from running |
Thanks, it is a socks5 proxy as you said. So I change the https_proxy to 'http://192.168.10.1:10899' make rustup and other commands working. I also have the confusion why rustup can't work but others can. |
I can confirm the behavior and right fix for The fix is to change Then rustup is able talk to static.rust-lang.org. Is it a bug that rustup does not use |
No, this is a bug that your proxy doesn't support https:// proxy urls properly, and you've not encountered it otherwise because your OS is running old enough versions of curl that it doesn't support them properly either. Is there a chance you can unset the https proxy variable? Most things will then fall back to the all proxy anyway, which should be set to an http:// url which will then work. |
@pJunger what does "something" exactly mean? |
Problem
Any command like
update
,check
. etc. fails withoperation timed out
if a proxy is set with a leading http://.Steps
export http_proxy=http://gateway.something.net:10402
(&export https_proxy=http://gateway.something.net:10402
)rustup update
Possible Solution(s)
Workaround is possible by removing the http://
Notes
OS:
Output of
rustup --version
:Output of
rustup show
:Edit: The * was meant only for obfuscation, replaced it with "something".
The text was updated successfully, but these errors were encountered: