test connect_timeout does not seem to work
26 of the 27 test pass, excluding connect_timeout.
instead of resulting in a timeout, ssh seems to fail with:
"connect to host 192.0.0.8 port 22: Network is unreachable"
when changing the test's host ip e.g. to the google dns 8.8.8.8 it works.
Just run it again.
Sometimes timeout might fail, but it usually works.
BTW, this is related to #41 , so I expected you to post this in the Pull Request
@stepga If the problem is solved, can we close this issue?
Just run it again. Sometimes timeout might fail, but it usually works.
Strange. It fails reproducibly every time I run run_ci_tests.sh
BTW, this is related to https://github.com/jonhoo/openssh-rs/pull/41 , so I expected you to post this in the Pull Request
This happens on origin/master 26e275654768519a0e3f676e5473d86b43228816.
edit: fixed commit
Strange. It fails reproducibly every time I run run_ci_tests.sh
That is definitely strange.
This happens on origin/master e1c02a749aba7352021b7a8b24ce15555271b1e2.
Can you try the latest commit of master?
Strange. It fails reproducibly every time I run run_ci_tests.sh
That is definitely strange.
This happens on origin/master e1c02a7.
Can you try the latest commit of master?
i updated/edited the former post: this happens for me with https://github.com/jonhoo/openssh-rs/commit/26e275654768519a0e3f676e5473d86b43228816
instead of resulting in a timeout, ssh seems to fail with: "connect to host 192.0.0.8 port 22: Network is unreachable"
when changing the test's host ip e.g. to the google dns 8.8.8.8 it works.
Looking at the error message, this actually matches the host used in connect_timeout.
The test basically specifies a random host and port, expects ssh connection to fail, it is not very robust.
Although I don't understand why changing the host ip fixed the problem.
@jonhoo I don't think I can figure a solution to this one.
Can you please lend me some help here?
Hmm, this sounds an awful lot like you have firewall rules that treat 192.0.0.8 specially. Or maybe that somehow matches your own local network? I think we need more info here, like your OS, the firewall you're using (if any), and your local network config (ip + netmask).
I am seeing a similar issue when I try to ssh to an IP address that is only exposed when my VPN is on.
ssh will hang indefinitely if the ConnectTimeout is not set, but will finish if the ConnectTimeout is set.
ssh 172.16.1.2 -o ConnectTimeout=1
ssh: connect to host 172.16.1.2 port 22: Connection timed out
The example in my code appears to hang forever which indicates that the ConnectTimeout is not being passed correctly. The code works fine when my VPN is enabled.
let _sb = SessionBuilder::default()
.connect_timeout(Duration::new(2, 0))
.known_hosts_check(KnownHosts::Accept)
.connect("172.16.1.2")
.await;
Now it is working for me. I didn't change anything, so I am confused. You can ignore my previous comment.