cargo下载失败报SSL connect error
现象:
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