I am using Rebex for SFTP Connectivity. With the older version of Rebex(2.0.4086.0) sftp connectivity had no issue and worked in one sever. Updated the same to another similar server.In that we got the exception "Getting "Key exchange failed. Requested service is not implemented." when connecting to SFTP.
We added higher version of Rebex dlls in that server and it worked .
But the doubt is with older version of Rebex, sftp connectivity worked in one server and not in the other server. Same SFTP Server(version-7.6)is being used in both application servers when queried there and the platform in Linux Red Hat Platform)
Code used to connect to SFTP
private void ConnectSftp(ref Sftp objSFTP)
{
try
{
SftpConnectionState IsActive = null;
string[] sSFTPHost = ConfigurationSettings.AppSettings["SFTPHost"].Split('|');
if (objSFTP == null)
{
objSFTP = new Sftp();
}
IsActive = objSFTP.GetConnectionState();
if (IsActive.Connected == false)
{
objSFTP.Connect(sSFTPHost[0], int.Parse(sSFTPHost[1]));
objSFTP.Login(sSFTPHost[2], sSFTPHost[3]);
}
try
{
SetSFTPStatus("C", 2);
}
catch { }
}
catch (Exception ex)
{
objSFTP.Disconnect();
Common.WriteLogService("Error while connecting SFTP: " + ex.Message,ex.StackTrace,true);
try
{
SetSFTPStatus("E", 2);
}
catch { }
}
}