Jsch Identification string not by the RFC 4253 spec
Status: Alpha
Brought to you by:
ymnk
Identification string sent by Jsch while setting up connection does not follow RFC4253 specification (section 4.2): "When the connection has been established, both sides MUST send an
identification string. This identification string MUST be
SSH-protoversion-softwareversion SP comments CR LF"
Jsch is not sending "CR LF" at the end but only "LF" it can cause problems during connection setup (delay in my case).
Following fix solves the issue (Session.java, line 253):
byte[] foo=new byte[V_C.length+2];
System.arraycopy(V_C, 0, foo, 0, V_C.length);
foo[foo.length-2]=(byte)'\r';
foo[foo.length-1]=(byte)'\n';