【发布时间】:2018-04-23 15:00:44
【问题描述】:
我无法让货物在经过身份验证的代理后面的 Windows 下开始任何下载。
这是我的代理设置:-
C:\Users\ukb99427\Downloads
λ set | grep http
https_proxy=http://user:pass@corporate.proxy:8080
http_proxy=http://user:pass@corporate.proxy:8080
注意 https_proxy 有一个 http 地址。这使得 git 之类的东西以及 rustup-init 和 rustup 可以正常工作。这些输出是
λ rustup update
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
info: latest update on 2017-11-10, rust version 1.23.0-nightly (d6b06c63a 2017-11-09)
info: downloading component 'rustc'
33.4 MiB / 33.4 MiB (100 %) 2.7 MiB/s ETA: 0 s
但是当运行等效的cargo install 命令时,我得到以下信息
λ cargo install libc
Updating registry `https://github.com/rust-lang/crates.io-index`
warning: spurious network error (2 tries remaining): [12/-2] [56] Failure when receiving data from the peer
warning: spurious network error (1 tries remaining): [12/-2] [56] Failure when receiving data from the peer
作为测试,我可以运行 curl
λ curl --insecure https://github.com/rust-lang/crates.io-index -o registry.html
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 785k 0 785k 0 0 389k 0 --:--:-- 0:00:02 --:--:-- 393k
或者,我尝试将 https_proxy 设置为 https://user:pass@corporate.proxy:8080
并得到以下内容
λ cargo install libc
Updating registry `https://github.com/rust-lang/crates.io-index`
warning: spurious network error (2 tries remaining): [12/-2] [4] A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision. (Unsupported proxy 'https://user:pass@corporate.proxy:8080', libcurl is built without the HTTPS-proxy support.)
warning: spurious network error (1 tries remaining): [12/-2] [4] A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision. (Unsupported proxy 'https://user:pass@corporate.proxy:8080', libcurl is built without the HTTPS-proxy support.)
error: failed to fetch `https://github.com/rust-lang/crates.io-index`
Caused by:
[12/-2] [4] A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision. (Unsupported proxy 'https://user:pass@corporate.proxy:8080', libcurl is built without the HTTPS-proxy support.)
供参考 curl --version 输出
λ curl --version
curl 7.53.0 (x86_64-w64-mingw32) libcurl/7.53.0 OpenSSL/1.0.2k zlib/1.2.11 libssh2/1.8.0 nghttp2/1.19.0 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp
Features: IPv6 Largefile SSPI Kerberos SPNEGO NTLM **SSL** libz TLS-SRP HTTP2 HTTPS-proxy Metalink
货运版
λ cargo version
cargo 0.24.0-nightly (b83550edc 2017-11-04)
有没有办法让货物使用与 rustup、git 或 curl 相同的设置?其他应用程序工作正常,使用 sslverify=false(例如 git),这充其量是一种解决方法,但可以让我到达某个地方而不是无处可去。
这一切都在 Windows10 上,在经过身份验证的代理之后。在没有给出用户/密码的情况下,它(和任何应用程序)以 http 错误 407 退出,这是有道理的。对于 Windows 应用程序,它们使用运行良好的 IE 设置(适用于 Visual Studio Code 或任何类似应用程序)
我能想到的唯一替代方法是强制所有内容仅使用 http,但我不知道有任何设置可以让货物发生这种情况。
还有什么我可以尝试的想法吗?
【问题讨论】:
标签: ssl rust rust-cargo