-
-
Notifications
You must be signed in to change notification settings - Fork 940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server identification problem in NETStandart 2.0 #377
Comments
Can you provide more information? Do you have a small application (source) that allows me to reproduce this issue? What version of SSH.NET are you using? |
I've got small server and I'm trying to access using code: I use 2016.1.0 version. |
Why do you mention .NET Standard 2.0 in the issue? We do not yet ship a .NET Standard 2.0 version. |
I am experiencing this issue too, I'm using 2016.1.0 from NuGet, and building a UWP app against Fall Creators Update. I get failed SFTP connections on both my Linux server and Mac server. Both work fine with my other SFTP clients. Version 2013.4.7 from NuGet doesn't have the problem, but I don't really want to drop back to such and old version. |
Sorry, maybe I made a mistake and an issue caused by .NET Standart 1.3. Could you reproduce this issue? |
For me version 2013.4.7 produced |
@Kutikov Won't have time today. I'll try to test it tomorrow. |
So is it any progress? If you don`t find out issue now, could you please build separated .NETCore SSH.NET for us to using it, while this issue would be fixed? |
Sorry too busy at work. Hope to have time this weekend. |
I have encontered the same issue when connect sshclient, it throwing the exception: |
"Server response does not contain SSH protocol identification" Connecting from:
I connect to my linux s/FTP servers fine but when attempting to connect to:
I am using simple username + password authentication. Is there some setting or code snippet that I can use to force compatibility? I found the message in source in session.cs [612], is there a possible variation in the RegEx that should be considered? |
Are you sure the 2008R2 is SSH/SFTP? The built in FTP server is FTP/FTPS(over SSL) and that is a nother protocol not SSH based
…Sent from my iPhone
On Mar 26, 2018, at 2:03 PM, Stuart Williams (Magenic) ***@***.***> wrote:
"Server response does not contain SSH protocol identification"
Connecting from:
Server 2012
.NET CLR 4.6.1
I connect to my linux s/FTP servers fine but when attempting to connect to:
Server 2008r2
Windows s/FTP server
I am using simple username + password authentication.
Is there some setting or code snippet that I can use to force compatibility?
I found the message in source in session.cs [612], is there a possible variation in the RegEx that should be considered?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@lyzl Was looking for a fix for a while and downgrading worked great to get it working on Build 16299, thanks! |
@Kutikov @theescapers @lyzl Can any of you still consistently reproduce this issue? |
@drieseng, at this moment I can't check up functionality due to not using UWP and .NET Standart 1.3 |
hello, |
I reproduce on 10% of our integration builds. Not consistently |
Experiencing the same issue in my UWP app. It works when I have set build 10240/14393/15063 as min target version and it stops working as soon as I set the min target version to build 16299/17134. |
Also receiving this error in .NET Core 2.1 on CentOS. Doesn't happen on all sftp connections... just one that I know of so far. Will see if I can gather some useful details later. |
Experiencing this issue too in UWP app on Windows IoT Core on raspberry pi 3 model b - and unfortunately, it is occurs in the critical function of the project |
while waiting for a solution I use: |
one single huge commit :\ wish it was better documented as to what the changes are
… On Nov 15, 2018, at 4:13 AM, Doods ***@***.***> wrote:
while waiting for a solution I use:
https://github.com/asmodat/Asmodat-Standard-SSH.NET <https://github.com/asmodat/Asmodat-Standard-SSH.NET>
He corrected the problem.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#377 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAf0HgP9guWLJ12lnYQtVgH6Rrp9aNnAks5uvSIdgaJpZM4Rl-Gv>.
|
For me, this is not the best alternative in the long run. |
Do any of you have a server I can reproduce this issue again? |
@drieseng I sent you an email with my contact informations. I will be able to show you my configuration which is having this issue. |
After validating, it seems this issue is caused by the SFTP server actively refusing the connection using either a firewall rule or some sort of IP-based blocking. This is not an issue caused by SSH.NET but rather by the connectivity to your SFTP server. |
@doodz @Kutikov @theescapers Can any of you consistently reproduce this issue, and provide me access to one of the (test) servers that show this issue? |
hello @drieseng sorry for the late. |
I am having this problem with Iot Core, but only when using the loop back address in my UWP app. I use the loop back to run system commands outside of the app sandbox. NOTE: I've not done a complete code analysis, this is just what I came up with after stepping through the code a few times. I believe that it has something to do with the loop back connection being much faster than than the remote connection, but I'm not certain. E.g. If I step through the code, and get the point that is highlighted in the below image, I get an unhanded I'm not sure why it only does it when I step through the code, but I suspect that, since the Anyway, I notice that the cause of the error is that when verifying the server version, there are no bytes returned. However, if you modify the It returns the correct number of bytes read. You would also need to modify all other instances of the "sendReceiveToken.TotalBytesTransferred" for determining the number of bytes read. However, rather than modifying the code, which seems risky to me since I don't know what kind of regression that might cause, I chose to define the In my calling code I run a SSH command like this with a timeout: |
I'm also seeing .NET version: Core 2.1 The function tries to connect to the same server multiple times, each attempt with a different user/pass combination and performs some operations on dirs and files. This is a snippet of the code that randomly raise this error: private void ProcessDirectories(string process_path, ref SftpClient sftp)
{
try
{
if (!sftp.IsConnected)
{
sftp.Connect(); // <-- It fails here
}
if (!Directory.Exists(process_path + "/processed"))
{
Directory.CreateDirectory(process_path + "/processed");
}
DirectoryInfo directory = new DirectoryInfo(process_path);
... // More data processing
}
} maybe there's an issue with passing the |
We are also seeing this with .NET Core 2.2 and C# in Azure. It is fairly consistent; it happens with some servers and not with others. Unfortunately only in production, so I can't provide a test server. I will be happy to help testing a fix though. @lprofitt did you create a fork? Ideally I'd like to change the calling code that I control rather than code in the library itself unless the official library can be fixed. |
@erik-wramner, I did not create a fork, I just modified my local copy. |
Any updates on solving this? |
I'm receiving this issue as well. any updates/ quick fixes? |
I'm also seeing this Exception a few times a day in our production environment: SSH.NET version: NuGet 2016.1.0.0 |
Also experiencing that issue on our side |
Working fine locally in windows 10 but throwing exception in azure function app. |
I had the same issues. I started to try using other solutions on NUGET. Actually a Fork from Renci/SSH.NET solved this problem if anyone still is having issues. |
I've identified a bug in our EAP socket implementation that surfaces when an async operation completes synchronously. |
I am getting ""Server response does not contain SSH protocol identification" consistently. I am trying to ssh to a hardware in my LAN. Putty ssh works. |
I have the same issue using SSH.NET within my Azure Function deployed to Microsoft Azure. I use this library to check each minute for new files to download them and move them to another folder (just small text files). It works for about 1-3 days and then it stops working until I stop and start the Function again. I'm using SSH.NET version 2016.1.0 in my .NET Core 3.1 project. Maybe this information helps resolving the issue. "Just my code" stack trace: |
Fixed in 916c019. |
I've tried a build using the source code from May 3rd 2020 which has this fix but I still get the same issue when running on Azure Function: works fine for a day and then "Server response does not contain SSH". Using .NET Core 3.1 on Azure Function v3. |
@fnicollier Can you reproduce this issue outside of Azure? Do you have a server I can test against? |
Sadly I can't reproduce this outside of Azure. I'm trying the change you suggest and will report back after we've done testing. Update 1: Ran some tests and as before it first seems to run fine but eventually returns an error. But this time I'm getting the following error "An existing connection was forcibly closed by the remote host" which points to a server issue which would be an improvement. |
@fnicollier Thanks for the feedback |
Update 2: No more problem. It seems the issue was server-side but the change you suggested allowed us to get a nice meaningful error message ("An existing connection was forcibly closed by the remote host") instead of the cryptic SSH one ("Server response does not contain SSH"). |
2020.0.0-beta1 is now available, and includes this fix. |
Thanks for maintaining this library! |
... and thanks for appreciating it :p |
Since we had this issue with version 2016.1.0.0, I retried with the 2020.0.0-beta1 release but the problem still persist. Renci.SshNet.Common.SshConnectionException: Server response does not contain SSH protocol identification. SSH.NET version: NuGet 2020.0.0-beta1 |
I just updated Windows on my computer and am getting this now. None of my code has changed. |
I have also this problem like @EddyRts. Hopefully updated my version to 2020.0.0-beta1 but still getting this error: Server response does not contain SSH protocol identification I am also on Win Server 2019 + .NET framework 4.7.2 |
Can one of you provide (private) access to a non-production server that allows me to reproduce this issue? |
Renci.SshNet.Common.SshConnectionException: "Server response does not contain SSH protocol identification."
- VS 2017, causes only using UWP with NETStandart 2.0, but on UWP with NETCore there were no problems. After 2,5 hours of testing I`ve found out that problem is in timeouts of Session/ Could you fix it up?The text was updated successfully, but these errors were encountered: