Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error due to Proxy and User-Agent #5494

Closed
realex587 opened this issue May 7, 2018 · 2 comments · Fixed by #5522
Closed

Error due to Proxy and User-Agent #5494

realex587 opened this issue May 7, 2018 · 2 comments · Fixed by #5522
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@realex587
Copy link

realex587 commented May 7, 2018

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"
@alexcrichton
Copy link
Member

Ah currently you can't customize the user agent but it shouldn't be too hard to add such a configure option!

@alexcrichton alexcrichton added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label May 7, 2018
@DarkDrek
Copy link
Contributor

I want to add this option

DarkDrek added a commit to DarkDrek/cargo that referenced this issue May 11, 2018
bors added a commit that referenced this issue May 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants