Connection reset when calling from within IIS
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- csharp
- Área
- backend, networking
Línea de trabajo
Empieza reproduciendo el restablecimiento de la conexión de la aplicación ASP.NET heredada bajo IIS y compáralo con la aplicación web de prueba, el servicio de Windows y los casos de SSH desde la línea de comandos. Revisa los cambios mencionados en applicationHost.config y web.config y recopila suficiente información para distinguir el contexto de IIS de las rutas que funcionan. Se considera terminado cuando se haya identificado una causa reproducible o un diagnóstico práctico para el restablecimiento.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
We have a legacy asp.net application that uses Renci.SshNet to upload files to a linux box. It's been working for years. We upgraded the version of ssh on the linux machine, and had to upgrade our application to the latest version of Recni.SshNet... 2025.0.0. Now, the application refuses to connect to the linux box. The only error we receive is "connection reset". The same error is reported on the server, with no additional information.
For credentials, we're using a .pem file located in a directory off the root of drive C. I've tried a dozen different permission combinations on this file. And I believe it's not a file permissions problem. The asp.net application that fails is able to read the contents of the .pem file.
I copied the code over to a test web application. And the code works there.... same code, same server, same application pool, same credentials, same file to upload, same destination server.
We also have similar code in a Windows service that uses Renci.SshNet to download the same file from the same linux machine. That code works.
I tried connecting from the windows iis server using a command line ssh with the same credentials. That works. I also tried to call the same command line ssh command from within the legacy asp.net application. That also fails with connection reset.
I can sometimes make this work by playing with various settings in applicationHost.config and web.config. Removing a seemingly unrelated module made it suddenly start working. It worked for a few minutes with maybe half a dozen successful upload attempts. So I put the module back in to verify that this was in fact the cause. And the upload quit working. So I took it back out, and it stayed not working. Sometimes I can get this same behavior by adding, removing, or changing certain entries in applicationHost.config or web.config. But it never sticks. After a few uploads, it stops working again. iisreset between every config file change. iisreset has no effect on whether this works or not.
I believe I'm chasing some kind of race condition in the unmanaged code in IIS. When I make a change to one of the config files, I think it forces iis to reload something in memory, allowing Renci.SshNet to work for a few minutes. Then it does something or loads something else which causes it to fail again.
I'm 100% stuck. At this point, my options are to redesign the file upload so that the asp.net application asks the windows service or something else outside the context of iis to do the upload for it. Or I have to remove Renci.SshNet and use some other library.
The main problem is that I have zero visibility. There's no information in any of the error messages to help me identify the root cause. I have to simply guess, again and again, and hope that I guess right in finding the cause. Can you offer any kind of assistance to get this working?
- Lenguaje dominante
- C#
- Estrellas
- 4.4k
- Forks
- 993
- Merge medio
- 9 d 21 h
- PR fusionados (30 d)
- 1
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de sshnet/SSH.NET
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
-
Using SshClient on Linux under Wine throws System.Security.Cryptography.CryptographicException Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 67/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Todos los issues de sshnet/SSH.NET
Issues similares
-
effort:S P3 refactor
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
nightscout/nocturne#1532 ·
-
core dependencies
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
C#/.NET Roslyn LSP Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Suspicious code fragments Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
DotNetNext/SqlSugar#1458 ·