SftpClient.Connect keeps retrying even on authentication failure
Open
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 993
- Avg merge
- 9d 21h
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at SftpClient.Connect() and trace how authentication failures are handled during connection attempts. Reproduce the issue with the provided invalid-credentials example, then verify that an authentication failure returns immediately without retrying or being replaced by a connection-timeout error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100