Alexander Koshevoy
2015-07-06 08:58:31 UTC
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
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