Atsuhiko Yamanaka schrieb: > Hi, > > Sorry for my delay of reply,
No problem, I have enough other things to do in the meantime. (And also, Axis seems to not provide any way to set a specific SocketFactory object, only a SocketFactory class name, thus I'll have to use normal port forwarding for my project.) > +-From: Paul Ebermann <paul-eberm...@gmx.de> -- > |_Date: Fri, 20 May 2011 03:24:27 +0200 _______ > | > |I tried to open a direct-tcpip channel to some TCP server which replies > |with a message and immediately closes the connection. (See [0] for > background.) > ... > |As we can see, the remote host sends an SSH_MSG_CHANNEL_EOF before our > channel's > |connect() method had the chance to even see that the connection is open, > and thus > |it throws an exception instead of simply returning. > > You are right. It must be a bug. Could you try the following? > http://www.jcraft.com/jsch/jsch-0.1.45-rc3.zip Now the StreamForwarding example doesn't do anything after connecting (independently of whether the server sends something, ends the stream or not). Applying my debugging patches on it results in this (I added "timeout" or "failure" to the two Exception messages in ChannelDirectTCPIP.connect(), corresponding to the comment there): INFO: Connecting to 141.20.23.223 port 22 INFO: Connection established INFO: Remote version string: SSH-2.0-dropbear_0.52 INFO: Local version string: SSH-2.0-JSCH-0.1.45 INFO: CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256 INFO: CheckKexes: diffie-hellman-group14-sha1 INFO: SSH_MSG_KEXINIT sent INFO: SSH_MSG_KEXINIT received INFO: kex: server->client aes128-ctr hmac-md5 none INFO: kex: client->server aes128-ctr hmac-md5 none INFO: SSH_MSG_KEXDH_INIT sent INFO: expecting SSH_MSG_KEXDH_REPLY INFO: ssh_rsa_verify: signature true WARN: Permanently added '141.20.23.223' (RSA) to the list of known hosts. INFO: SSH_MSG_NEWKEYS sent INFO: SSH_MSG_NEWKEYS received INFO: SSH_MSG_SERVICE_REQUEST sent INFO: SSH_MSG_SERVICE_ACCEPT received INFO: Authentications that can continue: publickey,keyboard-interactive,password INFO: Next authentication method: publickey INFO: Authentications that can continue: password INFO: Next authentication method: password INFO: Authentication succeeded (password). System.{in,out} will be forwarded to localhost:2006. DEBUG: waiting 5000 ms for channel reply ... DEBUG: packet received, type: 91 INFO: SSH_MSG_CHANNEL_OPEN_CONFIRMATION received, channel: 0 DEBUG: ... finished waiting for channel reply Exception in thread "main" com.jcraft.jsch.JSchException: channel is not opened (failure). at com.jcraft.jsch.ChannelDirectTCPIP.connect(ChannelDirectTCPIP.java:141) at StreamForwarding.main(Unknown Source) DEBUG: packet received, type: 94 INFO: SSH_MSG_CHANNEL_DATA received, channel: 0, len: 804 DEBUG: packet received, type: 96 INFO: SSH_MSG_CHANNEL_EOF received, channel: 0 DEBUG: packet received, type: 97 INFO: SSH_MSG_CHANNEL_CLOSE received, channel: 0 It creates the channel (and receives packets), but still throws an Exception here. (The packets don't appear on stdout, here.) PaĆlo ------------------------------------------------------------------------------ vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 _______________________________________________ JSch-users mailing list JSch-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jsch-users