hierynomus / hierynomus/sshj

timeout expired in download file

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

Description

Hi

I'm trying to download a file via sftp using your library (v. 0.38.0)
My code is this:

try (SSHClient client = new SSHClient();
){

client.addHostKeyVerifier(new PromiscuousVerifier());

client.setConnectTimeout(60000);

client.connect(remoteHost, port); //timeout here
client.useCompression();
client.authPassword(username, password);
try (SFTPClient sftpClient = client.newSFTPClient();) {
sftpClient.get(this.remoteDir+"/"+fileName ,this.localDir);
}

client.disconnect();

}

calling the connect method waits until the timeout occurs:

net.schmizz.sshj.transport.TransportException: Timeout expired: 30000 MILLISECONDS

entering the code in debug I noticed that it stops in the net.schmizz.sshj.transport.KeyExchanger class at line 160:
waitForDone();

Can you give me some suggestions?
Thank you
Luca

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.