Skip to content

The connection was closed by the server: idle connection timeout expired (ProtocolError) #952

Closed

Description

@Shafqat-Ali

Hi, @IgorMilavec @drieseng
I'm using ssh.net library for CISCO SG-350 switch configuration from C# web application and facing this error for only CISCO SG-350 model.
All the commands are working fine for CISCO SG-300 and HP switch but I'm unable to make connection only for CISCO SG-350 model.
If anyone facing and solved the same issue, please help me.

Error: The connection was closed by the server: idle connection timeout expired (ProtocolError).
StackTrace:
at Renci.SshNet.Session.WaitOnHandle(WaitHandle waitHandle, TimeSpan timeout)
at Renci.SshNet.Session.WaitOnHandle(WaitHandle waitHandle)
at Renci.SshNet.Session.Connect()
at Renci.SshNet.BaseClient.CreateAndConnectSession()
at Renci.SshNet.BaseClient.Connect()

Activity

  1. IgorMilavec commented on Apr 23, 2022

    @IgorMilavec
    Collaborator

    At first glance it seems that SG-350 is not responding. Are you able to connect using telnet? Did you try to capture network traffic (you can use Wireshark) and see what is happening?

  2. Shafqat-Ali commented on Apr 23, 2022

    @Shafqat-Ali
    Author

    @IgorMilavec From same PC using Putty I can run all the commands, but from ssh.net library I'm getting this error "The connection was closed by the server: idle connection timeout expired (ProtocolError)."

  3. IgorMilavec commented on Apr 23, 2022

    @IgorMilavec
    Collaborator

    Can you capture network traffic in both cases and check for differences?

  4. Shafqat-Ali commented on Apr 23, 2022

    @Shafqat-Ali
    Author

    Can you capture network traffic in both cases and check for differences?

    Sure, I'll capture network traffic and share results here.
    Thank you for your prompt response.

  5. Shafqat-Ali commented on Apr 25, 2022

    @Shafqat-Ali
    Author

    Can you capture network traffic in both cases and check for differences?

    NetworkTraffic.zip

    I attached files of traffic monitoring with Wireshark. Please use this filter: "(ip.src == 10.1.7.26 && ip.dst == 172.17.21.254) || (ip.src == 172.17.21.254 && ip.dst == 10.1.7.26)"

    Traffic monitored for Putty (file name): PuttySession.pcapng
    Traffic monitored for C# application traffic (file name): ApplicationSession.pcapng

    I'm not network expert to analyze the traffic. Please take a look into files. @IgorMilavec Please support.

  6. Shafqat-Ali commented on May 23, 2022

    @Shafqat-Ali
    Author

    @IgorMilavec @darinkes @hifi @drieseng
    Need your support for CISCO SG-350 switch connection using SSH.NET.
    Please help me with this issue.

  7. KrisMie commented on May 23, 2022

    @KrisMie

    @Shafqat-Ali @IgorMilavec @drieseng
    Not an expert here but by comparing those two Wireshark captures with recommended filters, it looks like the problem is that for some reason SSH.NET doesn't initiate Key Exchange process with the server.

    Then - as expected - sends [FIN, ACK] disconnection signal after 30s timeout due to inactivity.

    Why would the SSH/Net not start the Key Exchange Init?

  8. Shafqat-Ali commented on May 24, 2022

    @Shafqat-Ali
    Author

    @KrisMie Thank you for comparing Wireshark captured results and identification of issue.

    @IgorMilavec @darinkes @hifi @drieseng Please support for above mentioned issue by @KrisMie.
    I'm stuck at this point, Need support.

  9. geoffstewart commented on Sep 13, 2022

    @geoffstewart

    I have created a PR to resolve a similar issue I encountered: #972

  10. WojciechNagorski commented on Dec 21, 2023

    @WojciechNagorski
    Collaborator

    It's done in #1274

  11. added this to the 2023.0.1 milestone on Dec 21, 2023
  12. WojciechNagorski commented on Dec 29, 2023

    @WojciechNagorski
    Collaborator

    The 2023.0.1 version has been released to Nuget: https://www.nuget.org/packages/SSH.NET/2023.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions