SFTP connection Error - SSH host key fingerprint does not match pattern
After successfully connecting to SFTP using GUI, i am having trouble connecting to it in C# using visual studio.
ErrorMsg
can anyone help me with this error.
ErrorMsg
Code generated by GUISystem.ArgumentException
HResult=0x80070057
Message=SSH host key fingerprint "ssh-rsa ***********" does not match pattern /((ssh-rsa|ssh-dss|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))( |-))?(\d+ )?([0-9a-f]{2}(:|-)){15}[0-9a-f]{2}(;((ssh-rsa|ssh-dss|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))( |-))?(\d+ )?([0-9a-f]{2}(:|-)){15}[0-9a-f]{2})*/
Source=WinSCPnet
StackTrace:
at WinSCP.SessionOptions.SetSshHostKeyFingerprint(String s)
at AB.Barra.FTP.Program.Main(String[] args) in
// Set up session options SessionOptions sessionOptions = new SessionOptions { Protocol = Protocol.Sftp, HostName = "sftp.***.com", UserName = "********", Password = "********", SshHostKeyFingerprint = "ssh-rsa 2048 ****/*******************", }; sessionOptions.AddRawSettings("ProxyMethod", "3"); sessionOptions.AddRawSettings("ProxyHost", "********"); sessionOptions.AddRawSettings("ProxyPort", "8082"); using (Session session = new Session()) { // Connect session.Open(sessionOptions); // Your code }