hierynomus / hierynomus/sshj

Exception by sftp.close()

Open
#173 9 comments 0 reactions 0 assignees View on GitHub
undiagnosed
Dominant language
Java
Stars
2.7k
Forks
620
Avg merge
3d 23h
Merged PRs (30d)
11

Description

closing SFTPCient connection to a PSFTP server (www.psftp.de) dont seem to work as expected:

```
public static void main(String[] args) throws IOException {
final SSHClient ssh = new SSHClient();
ssh.addHostKeyVerifier(new PromiscuousVerifier());
ssh.connect("psftp");
ssh.authPassword("user", "pass");
try {
final SFTPClient sftp = ssh.newSFTPClient();
try {
sftp.put("/tmp/test.txt", "test.txt");
} finally {
sftp.close(); }
} finally {
ssh.disconnect();
}
}
```

```
Jan 30, 2015 4:26:29 PM net.schmizz.sshj.common.SecurityUtils$BouncyCastleRegistration run
Information: BouncyCastle registration succeeded
Jan 30, 2015 4:26:29 PM net.schmizz.sshj.DefaultConfig initCipherFactories
Warnung: Disabling high-strength ciphers: cipher strengths apparently limited by JCE policy
Jan 30, 2015 4:26:29 PM net.schmizz.sshj.transport.TransportImpl init
Information: Client identity string: SSH-2.0-SSHJ_0_9_2
Jan 30, 2015 4:26:29 PM net.schmizz.sshj.transport.TransportImpl init
Information: Server identity string: SSH-2.0-PSFTPd. Secure FTP Server ready
Jan 30, 2015 4:26:29 PM net.schmizz.sshj.connection.channel.direct.SessionChannel startSubsystem
Information: Will request `sftp` subsystem
Jan 30, 2015 4:26:29 PM net.schmizz.sshj.transport.TransportImpl die
Schwerwiegend: Dying because - {}
net.schmizz.sshj.transport.TransportException: Broken transport; encountered EOF
at net.schmizz.sshj.transport.Reader.run(Reader.java:59)

Jan 30, 2015 4:26:29 PM net.schmizz.sshj.transport.TransportImpl$1 notifyDisconnect
Information: Disconnected - UNKNOWN
Jan 30, 2015 4:26:29 PM net.schmizz.concurrent.Promise tryRetrieve
Schwerwiegend: <> woke to: net.schmizz.sshj.connection.ConnectionException: Broken transport; encountered EOF
Jan 30, 2015 4:26:29 PM net.schmizz.sshj.transport.TransportImpl$1 notifyDisconnect
Information: Disconnected - BY_APPLICATION
Exception in thread "main" net.schmizz.sshj.connection.ConnectionException: Broken transport; encountered EOF
at net.schmizz.sshj.connection.ConnectionException$1.chain(ConnectionException.java:32)
at net.schmizz.sshj.connection.ConnectionException$1.chain(ConnectionException.java:1)
at net.schmizz.concurrent.Promise.deliverError(Promise.java:95)
at net.schmizz.concurrent.Event.deliverError(Event.java:72)
at net.schmizz.concurrent.ErrorDeliveryUtil.alertEvents(ErrorDeliveryUtil.java:34)
at net.schmizz.sshj.connection.channel.AbstractChannel.notifyError(AbstractChannel.java:218)
at net.schmizz.sshj.connection.channel.direct.SessionChannel.notifyError(SessionChannel.java:229)
at net.schmizz.sshj.common.ErrorNotifiable$Util.alertAll(ErrorNotifiable.java:35)
at net.schmizz.sshj.connection.ConnectionImpl.notifyError(ConnectionImpl.java:262)
at net.schmizz.sshj.transport.TransportImpl.die(TransportImpl.java:588)
at net.schmizz.sshj.transport.Reader.run(Reader.java:67)
Caused by: net.schmizz.sshj.transport.TransportException: Broken transport; encountered EOF
at net.schmizz.sshj.transport.Reader.run(Reader.java:59)
```

If you only disconnect() without close() everything works fine...
This seems to be a PSFTP server issue only??

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.