rust-lang / rust-lang/cargo

Proxy authentication mechanism support in cargo

Open
#7,330 8 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-networking C-feature-request S-needs-design
Dominant language
Rust
Stars
15.5k
Forks
3k
Avg merge
23h 30m
Merged PRs (30d)
51

Description

Problem statement

Currently cargo does not support updating crates index from GitHub behind some types of proxy, e.g. NTLM (which can often be the case for companies that don't allow direct access to GitHub due to corporate security policies).

For example, I am able to download the index manually, via curl, e.g.:

curl -vv --proxy-ntlm -U <user>:<password> --proxy <https://proxy:8080> https://github.com/rust-lang/crates.io-index

But cargo fails to apply the correct authentication mechanism when dealing with the proxy.

Proposed solution

Ideally, it would be nice to be able to to specify in ~/.cargo/config:

[http]
proxy = "host:port" # HTTP proxy to use for HTTP requests (defaults to none)
proxy-auth = "ntlm" # negotiate, basic, digest, etc... 
proxy-user = "username"
proxy-password = "password"
...          

And cargo should use that config for proxy authentication.

Notes
There are few other proxy authentication (DIGEST, SPNEGO, etc.) methods that curl supports besides the NTLM, so eventually all of them might be supported by cargo.

This feature request was spawned off from Issue 6513

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing cargo's existing HTTP proxy configuration and request handling, then compare its supported authentication with the NTLM, DIGEST, and SPNEGO mechanisms described here. Done means cargo can configure and use the requested proxy authentication for crates.io index updates, with behavior covering the proposed credentials and authentication options.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.