Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Thank you Martin, it worked.

Re: SFTP connection Error - SSH host key fingerprint does not match pattern

You have probably used a recent version of WinSCP GUI to generate a code with SHA-256 fingerprint (what is good).
But you are trying to use the code with an old version of WinSCP .NET assembly that does not support SHA-256 fingerprints.
Please upgrade the assembly to the latest version.

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.
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})*/
at WinSCP.SessionOptions.SetSshHostKeyFingerprint(String s)
at AB.Barra.FTP.Program.Main(String[] args) in

Code generated by GUI
// 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
    // Your code

can anyone help me with this error.