Cargo registry behind proxy

I’ve started at a new company and have tried to install rust using rustup successfully, but cargo doesn’t work so well.

Using:

set https_proxy=http://xxxxxx:yyyyyy@corporateproxy
set http_proxy=http://xxxxxx:yyyyyy@corporateproxy

Note that the https_proxy has to be set to http otherwise we get the following error

 Downloading nom v4.0.0 (registry `C:\Users\ukb99427\crates.io-index.git`)
error: unable to get packages from source

Caused by:
  failed to download from `https://crates.io/api/v1/crates/nom/4.0.0/download`

Caused by:
  [4] A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision. (Unsupported proxy 'https://xxxxx:yyyyyy@corporateproxy', libcurl is built without the HTTPS-proxy support.)

After addressing that, we move on to building. The registry file download through a proxy fails with:-

cargo build
Updating `https://github.com/rust-lang/crate-io.index` index
warning: spurious network error (2 tries remaining): failed to receive HTTP 200 response: got 401; class=Net (12)
warning: spurious network error (1 tries remaining): failed to receive HTTP 200 response: got 401; class=Net (12)
error: failed to load source for a dependency on `gfx`

Caused by:
  Unable to update registry `https://github.com/rust-lang/crate-io.index`

Caused by:
  failed to fetch `https://github.com/rust-lang/crate-io.index`

Caused by:
  failed to receive HTTP 200 response: got 401; class=Net (12)

So I fixed this by adding to cargo.config

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

And using

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

to download the repo; which then gives this warning

warning: custom registry support via theregistry.indexconfiguration is being removed, this functionality will not work in the future

but finally works fine.

  1. What will be the fix for this warning, once this feature is deprecated?
  2. Why does cargo not work through a https proxy?

At least everything downloads and builds, but it was an effort to get to this point. Any thoughts?