sshnet / sshnet/SSH.NET

'An established connection was aborted by the server.' when passing connection info to the constructor

Aperta
#964 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
C#
Stelle
4.4k
Fork
993
Merge medio
9g 21h
PR unite (30g)
1

Descrizione

This is non urgent because there is a simple workaround, but I thought it might be worth reporting (at least partly because I couldn't find a solution on Google and only stumbled across this one by luck.

var targetFtpHost = "sftp.myserver.com";
var targetFtpHostUserName = "myUsername";
var targetFtpHostPassword = "myVerySecurePassword";

var connectionInfo = new ConnectionInfo(
    targetFtpHost, 
    22, 
    "sftp", 
    new PasswordAuthenticationMethod(targetFtpHostUserName, targetFtpHostPassword));

using (var sftp = new SftpClient(connectionInfo))
{
     sftp.Connect();
...

Up until Monday, this code was working to create a connection to the server. Then on Monday the server was updated and it started failing with the error 'An established connection was aborted by the server.' when Connect was called. (I think the server in question is using Globescape but I don't have access to it so unfortunately can't pass on any logs/info from there about what might have caused the problem).

When I replaced the line setting up the sftp object with
using (var sftp = new SftpClient(targetFtpHost, targetFtpHostUserName, targetFtpHostPassword))
it started working again!

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con SftpClient(ConnectionInfo) e i costruttori host/username/password, quindi segui i relativi percorsi Connect per confrontare il modo in cui ciascuno stabilisce la connessione SFTP. Il report non fornisce file o test del repository e non include log del server, quindi per considerare il lavoro completato sarebbe necessario riprodurre la differenza tra i costruttori oppure identificare perché i due percorsi si comportano in modo diverso con il server aggiornato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
networking
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.