You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The connection was closed by the server: idle connection timeout expired (ProtocolError) #952
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()
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?
@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)."
@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?
Activity
IgorMilavec commentedon Apr 23, 2022
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?
Shafqat-Ali commentedon Apr 23, 2022
@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)."
IgorMilavec commentedon Apr 23, 2022
Can you capture network traffic in both cases and check for differences?
Shafqat-Ali commentedon Apr 23, 2022
Sure, I'll capture network traffic and share results here.
Thank you for your prompt response.
Shafqat-Ali commentedon Apr 25, 2022
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.
Shafqat-Ali commentedon May 23, 2022
@IgorMilavec @darinkes @hifi @drieseng
Need your support for CISCO SG-350 switch connection using SSH.NET.
Please help me with this issue.
KrisMie commentedon May 23, 2022
@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?
Shafqat-Ali commentedon May 24, 2022
@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.
geoffstewart commentedon Sep 13, 2022
I have created a PR to resolve a similar issue I encountered: #972
WojciechNagorski commentedon Dec 21, 2023
It's done in #1274
WojciechNagorski commentedon Dec 29, 2023
The 2023.0.1 version has been released to Nuget: https://www.nuget.org/packages/SSH.NET/2023.0.1