Skip to content

Feature request: Add support for cargo proxy configuration to cargo upgrade #965

Description

@thiezn

To protect against the big rise in dependency confusion and compromised packages, we have implemented an internal 'cargo proxy' to be able to add policies to reduce exposure.

Cargo commands used for communicating with crates.io allows you to provide proxy server configuration in the .cargo/config.toml file:

cat /Users/MyUser/.cargo/config.toml 
[http]
proxy = "socks5h://192.168.1.1:6789"

[https]
proxy = "socks5h://192.168.1.1:6789"

Unfortunately, cargo upgrade doesn't respect the .cargo/config.toml configuration, neither does it seem to pick up on environment variables HTTP_PROXY/HTTPS_PROXY for communication.

Here's the output:

cargo upgrade --verbose                     
    Checking virtual workspace's dependencies
Error: error sending request for url (https://index.crates.io/an/yh/anyhow)

Caused by:
    0: client error (Connect)
    1: Socket is not connected (os error 57)

Would it be possible to add proxy support to cargo-edit commands where applicable? In my opinion the best way would be through cargo's generic configuration, but environment variables would also be an acceptable workaround.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions