Discussion:
[JSch-users] JSchException "timeout in wating for rekeying process." caused by waiting for user answer
Alexander Koshevoy
2015-07-06 08:58:31 UTC
Permalink
Hi!

We are using JSch library 0.1.52 and have a difficulty dealing with
timeout on establishing connection. The problem is that after a user
answers prompt dialog "The authenticity of host '***' can't be
established. RSA key fingerprint is ***. Are you sure you want to
continue connecting?" JSchException with "timeout in wating for rekeying
process." message is thrown by JSch Session (under some circumstances):
com.jcraft.jsch.JSchException: timeout in wating for rekeying process.
at com.jcraft.jsch.Session.write(Session.java:1339)
at com.jcraft.jsch.Session.send_newkeys(Session.java:695)
at com.jcraft.jsch.Session.connect(Session.java:348)
...

Steps to reproduce:
1. Be sure that the host we are connecting to is not in
~/.ssh/known_hosts (e.g. empty it)
2. Set com.jcraft.jsch.Session#setUserInfo(UserInfo) with implementation
that returns result from com.jcraft.jsch.UserInfo#promptYesNo() in
several seconds
3. Invoke com.jcraft.jsch.Session#connect(int) with timeout value that
is less than in step 2
4. Get JSchException

It seems that timeout value passed to Session#connect(int) method
applies both to user answer time from UI and server interaction time.
Might it be justly if user interaction had been excluded from timeout value?

Kind regards,
Alexander
Atsuhiko Yamanaka
2016-06-20 09:26:17 UTC
Permalink
Hi,

Sorry for my long long delay.

On Mon, Jul 6, 2015 at 5:58 PM, Alexander Koshevoy
Post by Alexander Koshevoy
We are using JSch library 0.1.52 and have a difficulty dealing with
timeout on establishing connection. The problem is that after a user
answers prompt dialog "The authenticity of host '***' can't be
established. RSA key fingerprint is ***. Are you sure you want to
continue connecting?" JSchException with "timeout in wating for rekeying
...
Post by Alexander Koshevoy
It seems that timeout value passed to Session#connect(int) method
applies both to user answer time from UI and server interaction time.
Might it be justly if user interaction had been excluded from timeout value?
Here is a patch to exclude user interaction time from timeout value.


Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
Skype callto://jcraft/
Twitter: http://twitter.com/ymnk
Facebook: http://facebook.com/aymnk

Loading...