SSH.NET
SSH.NET copied to clipboard
SftpClient.Connect keeps retrying even on authentication failure
Hello,
SftpClient.Connect() retries connection attempts even on authentication failure, should return immediately.
var connectionInfo = new ConnectionInfo("host", "username", new[]
{
new PasswordAuthenticationMethod("username", "password")
})
{
Timeout = TimeSpan.FromMilliseconds(5000),
RetryAttempts = 1
};
var sftpClient = new SftpClient(connectionInfo);
sftpClient.Connect();
Retrying with the same invalid credentials sounds wrong, plus Connect() takes longer until timeout, plus might throw on either password OR connection timeout (randomly).
Thank you in advance.
Hi @WojciechNagorski, what do you think about SftpClient.Connect not failing immediately (keeps retying) when authentication fails?
@superware TBH I do not have time for this topic right now. I want to focus on tasks that involve a large number of people first. I encourage you to propose a PR. I will review it then.
@superware, we should not retry in case of authentication failures. Are you sure that's what you're seeing?