Skip to content

Error due to Proxy and User-Agent #5494

Closed

Description

Hi,

I am getting the following output when trying to run "sudo cargo build":

Downloading base64 v0.6.0
warning: spurious network error (2 tries remaining): [56] Failure when receiving data from the peer (Received HTTP code 403 from proxy after CONNECT)
warning: spurious network error (1 tries remaining): [56] Failure when receiving data from the peer (Received HTTP code 403 from proxy after CONNECT)
error: unable to get packages from source                                       

Caused by:
  [56] Failure when receiving data from the peer (Received HTTP code 403 from proxy after CONNECT)

At first, I got the same error (HTTP code 403) for apt-get as well. Then I added the following user-agent to the /etc/apt/apt.conf file next to the proxy settings:

Acquire::http::User-Agent "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0";

After that, apt-get worked fine.

Is it possible to specify a user-agent somehow for cargo as well? I think my company-proxy is blocking the connection.

My current ~/.cargo/config file:

[http]
proxy = "http://user:pw@ip:port"
check-revoke = false
sslVerify = "false"


[https]
proxy = "https://user:pw@ip:port"
check-revoke = false
sslVerify = "false"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions