cargo icon indicating copy to clipboard operation
cargo copied to clipboard

SSL_connect: SSL_ERROR_SYSCALL behind a proxy

Open readams opened this issue 8 years ago • 5 comments

Trying to run cargo behind a proxy. Note that rustup immediately prior to this is successful, and curl is able to reach github without issues.

[root@fab7-compute-1 ~]# curl -o /dev/null https://github.com/
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 52814    0 52814    0     0  93135      0 --:--:-- --:--:-- --:--:-- 93310
[root@fab7-compute-1 ~]# cargo install click
    Updating registry `https://github.com/rust-lang/crates.io-index`
warning: spurious network error (2 tries remaining): [35] SSL connect error (OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to proxy.esl.cisco.com:80 ); class=Net (12)
warning: spurious network error (1 tries remaining): [35] SSL connect error (OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to proxy.esl.cisco.com:80 ); class=Net (12)
error: failed to fetch `https://github.com/rust-lang/crates.io-index`           

Caused by:
  [35] SSL connect error (OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to proxy.esl.cisco.com:80 ); class=Net (12)
[root@fab7-compute-1 ~]# env | grep -i proxy
http_proxy=https://proxy.esl.cisco.com:80
https_proxy=https://proxy.esl.cisco.com:80

readams avatar Mar 28 '18 18:03 readams

Hm this seems to indicate that weird errors are happening, perhaps the proxy isn't configured correctly? Or maybe Cargo isn't sending the right headers or something like that?

alexcrichton avatar Mar 28 '18 23:03 alexcrichton

Not sure. I've been able to successfully connect through this proxy with many different systems, including go, python, curl, etc. So it's quite possible Rust is doing some higher level of validation here. Maybe this shouldn't be a cargo issue but against the https stack. I'm fairly new to Rust ecosystem so I'd appreciate any pointers in the right direction.

readams avatar Mar 29 '18 17:03 readams

Ah sorry I've never seen this error before so I'm not sure what's going on :(

Are you sure the proxy is configured correctly? It looks like you're using an SSL proxy on an HTTP (not HTTPS) port, so I just wanted to confirm that was expected

alexcrichton avatar Mar 31 '18 21:03 alexcrichton

Yea the proxy settings are correct. You can see curl successfully using them to get https://github.com in the output above.

readams avatar Apr 02 '18 15:04 readams

If git is working, then open ~/.cargo/config and write:

[net]
git-fetch-with-cli = true

https://doc.rust-lang.org/cargo/reference/config.html

ngolin avatar Jan 22 '20 13:01 ngolin