Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinSSHD has a race condition with sending/receiving ident #176

Closed
hierynomus opened this issue May 26, 2016 · 0 comments
Closed

WinSSHD has a race condition with sending/receiving ident #176

hierynomus opened this issue May 26, 2016 · 0 comments

Comments

@hierynomus
Copy link
Contributor

Sometimes SSHJ will be faster in sending its client ident than the WinSSHD server is with sending its ident. This will result in the WinSSHD server to start sending a protocol message without first sending its own ident. The result of this is that SSHJ is not expecting the protocol message, because it is still waiting for the server ident (see hierynomus/sshj#118)

The stacktrace that you get is then:

Caused by: net.schmizz.sshj.transport.TransportException: Incorrect identification: line too long
at net.schmizz.sshj.transport.TransportImpl.init(TransportImpl.java:164)
at net.schmizz.sshj.SSHClient.onConnect(SSHClient.java:671)
at net.schmizz.sshj.SocketClient.connect(SocketClient.java:71)
at net.schmizz.sshj.SocketClient.connect(SocketClient.java:77)
at net.schmizz.sshj.SocketClient.connect(SocketClient.java:103)
at com.omneon.dam.util.bitspeed.BitSpeedUtil.openConnection(BitSpeedUtil.java:370)
at com.omneon.dam.util.bitspeed.BitSpeedUtil.exists(BitSpeedUtil.java:303)
... 19 more

Since hierynomus/sshj 0.16.0 this can be resolved by setting the Config.setWaitForServerIdentBeforeSendingClientIdent(true) configuration setting in case we are connecting to a WinSSHD box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant