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


Re: Alternative SshHostKeyFingerprint Formatting Issue

Worked! Thank you for your help!


Re: Alternative SshHostKeyFingerprint Formatting Issue

While the Regex.Match.Success is indeed true, it does not match whole string, just the first hostkey.

The assembly does not accept the space after the semicolon. Remove it.

Alternative SshHostKeyFingerprint Formatting Issue


I am using the .NET assembly of WinSCP574 in a SSIS project to establish a SFTP connection. The issue I am having is related to the fingerprint of the server, especially when providing multiple possible fingerprints (multiple values for SshHostKeyFingerprint).

Everything works just fine using just one Key:

SessionOptions sessionOptions = new SessionOptions
Protocol = Protocol.Sftp,
HostName = (string) Dts.Variables["User::HostName"].Value,
UserName = (string) Dts.Variables["User::UserName"].Value,
Password = (string) Dts.Variables["User::Password"].Value,
PortNumber = (string) Dts.Variables["User::PortNumber"].Value,
SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"

However, as soon as I add multiple SshHostKeyFingerprints with the following syntax, it fails:
SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx; ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"

The error message is, that the syntax doesn't match the pattern
((ssh-rsa|ssh-dss)( |-))?(\d+ )?([0-9a-f]{2}(:|-)){15}[0-9a-f]{2}(;((ssh-rsa|ssh-dss)( |-))?(\d+ )?([0-9a-f]{2}(:|-)){15}[0-9a-f]{2})*

In order to check that my syntax is correct, I did a check with Regex.Match, which returned true.

Am I missing anything? Is the current version of WinSCP still supporting multiple SshHostKeyFingerprints?

Thank you,