if (objSFTP == null) objSFTP = new Sftp(); //--- commented by mathew for SFTP Rebex connectivity issue on 20240513 --- // else // IsActive = objSFTP.GetConnectionState(); //-------------------------------------------------------------------------------------- IsActive = objSFTP.GetConnectionState(); if (IsActive == null || IsActive.Connected == false) { //--- Added by mathew for SFTP Rebex connectivity issue on 20240513 --- **string IsCipherPriorityRequired = string.Empty; IsCipherPriorityRequired = Common.GetParamValue("IsCipherPriorityRequired"); if (IsCipherPriorityRequired != string.Empty) { if (IsCipherPriorityRequired.ToUpper() == "YES") { **objSFTP.Settings.SshParameters.KeyExchangeAlgorithms = SshKeyExchangeAlgorithm.DiffieHellmanGroup14SHA1;** } }** //----------------------------------------------------------------------------- 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 { } } }
Welcome to Q&A forum for C# and VB.NET developers working with following .NET components:
Applications:
If you need immediate assistance, please contact us directly.