Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Connection reset when calling from within IIS

Abierto
#1,666 5 comentarios 0 reacciones 0 asignados Ver en GitHub

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

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

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de sshnet/SSH.NET

Todos los issues de sshnet/SSH.NET

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.