Skip to content

Cargo failed to download crates with https_proxy #11746

Closed
@akiirui

Description

@akiirui

Problem

Cargo failed to download crates when I set https_proxy=http://127.0.0.1:1081/:

$ cargo build
error: failed to download from `https://crates.io/api/v1/crates/want/0.3.0/download`

Caused by:
  [2] Failed initialization ([CONN-1-0] send: no filter connected)

Steps

  1. Set https_proxy environment varable
  2. git clone https://github.com/Morganamilo/paru.git
  3. cd paru
  4. cargo build

Possible Solution(s)

No response

Notes

Logs with CARGO_HTTP_DEBUG=true and CARGO_LOG=cargo::ops::registry=trace

[2023-02-21T06:45:03Z DEBUG cargo::ops::registry] http-debug: * Uses proxy env variable no_proxy == 'localhost,127.0.0.0/8,::1'
[2023-02-21T06:45:03Z DEBUG cargo::ops::registry] http-debug: * Uses proxy env variable https_proxy == 'http://127.0.0.1:1081/'
[2023-02-21T06:45:03Z DEBUG cargo::ops::registry] http-debug: *   Trying 127.0.0.1:1081...
---
[2023-02-21T06:45:03Z DEBUG cargo::ops::registry] http-debug: * Uses proxy env variable no_proxy == 'localhost,127.0.0.0/8,::1'
[2023-02-21T06:45:03Z DEBUG cargo::ops::registry] http-debug: * Uses proxy env variable https_proxy == 'http://127.0.0.1:1081/'
[2023-02-21T06:45:03Z DEBUG cargo::ops::registry] http-debug: * Found bundle for host: 0x5642948e47c0 [serially]
[2023-02-21T06:45:03Z DEBUG cargo::ops::registry] http-debug: * Server doesn't support multiplex yet, wait
[2023-02-21T06:45:03Z DEBUG cargo::ops::registry] http-debug: * No connections available.
* 190 times
---
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * Uses proxy env variable no_proxy == 'localhost,127.0.0.0/8,::1'
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * Uses proxy env variable https_proxy == 'http://127.0.0.1:1081/'
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * Found bundle for host: 0x5642948e47c0 [can multiplex]
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * MAX_CONCURRENT_STREAMS reached, skip (100)
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * Hostname 127.0.0.1 was found in DNS cache
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * Transfer was pending, now try another
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: *   Trying 127.0.0.1:1081...
---
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * Uses proxy env variable no_proxy == 'localhost,127.0.0.0/8,::1'
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * Uses proxy env variable https_proxy == 'http://127.0.0.1:1081/'
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * Found bundle for host: 0x5642948e47c0 [can multiplex]
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * MAX_CONCURRENT_STREAMS reached, skip (100)
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * No more connections allowed to host: 2
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * No connections available.
* 90 times
---
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * Connected to 127.0.0.1 (127.0.0.1) port 1081 (#1)
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * allocate connect buffer
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * Establish HTTP proxy tunnel to crates.io:443
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: > CONNECT crates.io:443 HTTP/1.1
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: > Host: crates.io:443
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: > User-Agent: cargo 1.67.1
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: > Proxy-Connection: Keep-Alive
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: > 
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: < HTTP/1.1 200 Connection established
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: < 
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * CONNECT phase completed
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * CONNECT tunnel established, response 200
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * ALPN: offers h2,http/1.1
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * TLSv1.3 (OUT), TLS handshake, Client hello (1):
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
---
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * Uses proxy env variable no_proxy == 'localhost,127.0.0.0/8,::1'
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * Uses proxy env variable https_proxy == 'http://127.0.0.1:1081/'
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * Found bundle for host: 0x5642948e47c0 [can multiplex]
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * client side MAX_CONCURRENT_STREAMS reached, skip (100)
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * Multiplexed connection found
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * Re-using existing connection #1 with proxy 127.0.0.1
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * Transfer was pending, now try another
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * [CONN-1-0] send: no filter connected
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * Failed sending HTTP request
* 90 times
---
[2023-02-21T06:45:04Z DEBUG cargo::ops::registry] http-debug: * Callback aborted
* 101 times

Version

cargo 1.67.1
release: 1.67.1
host: x86_64-unknown-linux-gnu
libgit2: 1.5.0 (sys:0.16.0 vendored)
libcurl: 7.88.1-DEV (sys:0.4.59+curl-7.86.0 system ssl:OpenSSL/3.0.8)
os: Arch Linux [64-bit]

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-networkingArea: networking issues, curl, etc.C-bugCategory: bugS-blocked-externalStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions