cargo ssl download error behind proxy on windows

房东的猫 提交于 2019-12-03 17:16:50

I struggled with this a while but finally figured out a work around. I post this here as a possible solution for those behind corporate firewalls. It does, sadly, reduce adoption of rust if people can't install it easily at work.

Download the crates-io from github

git clone --bare https://github.com/rust-lang/crates.io-index.git

In $HOME/.cargo/config file set the registry like

[registry]
index = "file:///C:/Users/someuser/crates.io-index.git"

This stops the registry download via libgit-curl which apparently doesn't support https_proxy.

A longer term solution I think (but I've not tested this yet), is to rebuild cargo with libgit-curl supporting https.

Now (not sure if it was possible at the time) you have another possible solution for this issue, by updating your ~/.cargo/config this way :

[http]
proxy = "http://<user>:<password>@<proxy_url>"
check-revoke = false
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!