現象:
cargo build 時下載失敗(Windows 10 x64, build 1903),提示:
warning: spurious network error (2 tries remaining): [35] SSL connect error (schannel: next InitializeSecurityContext fa
iled: Unknown error (0x80092013)
iled: Unknown error (0x80092013)
error: failed to download from `https://crates-io.proxy.ustclug.org/api/v1/crates/chrono/0.4.9/download`
Caused by:
[35] SSL connect error (schannel: next InitializeSecurityContext failed: Unknown error (0x80092013)
Caused by:
[35] SSL connect error (schannel: next InitializeSecurityContext failed: Unknown error (0x80092013)
分析:
用curl -v https://crates-io.proxy.ustclug.org/api/v1/crates/chrono/0.4.9/download
提示:
* schannel: shutting down SSL/TLS connection with crates-io.proxy.ustclug.org port 443
* schannel: clear security context handle
curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092013) - 由於吊銷服務器已脫機,吊銷功能
無法檢查吊銷。
* schannel: clear security context handle
curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092013) - 由於吊銷服務器已脫機,吊銷功能
無法檢查吊銷。
而用curl -kv https://crates-io.proxy.ustclug.org/api/v1/crates/chrono/0.4.9/download
或
curl -v --ssl-no-revoke https://crates-io.proxy.ustclug.org/api/v1/crates/chrono/0.4
.9/download
可以下載。
解決方案:
在~/.cargo/config中加入
[http] check-revoke = false
或者:
調置環境變量CARGO_HTTP_CHECK_REVOKE=false