Post a reply

Options
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)

Options

Topic review

KindnessHelps

Thanks for the help!

Changed the above settings to the suggestions and added:
$sessionOptions.FtpSecure = [WinSCP.FtpSecure]::ExplicitTls
martin

Re: SSH host key fingerprint "sha-rsa 2048 does not match patter

In GUI you are obviously connected with FTP over TLS.
So you need to use the SessionOptions.SslHostCertificateFingerprint and set SessionOptions.Protocol to Ftp and SessionOptions.FtpSecure to Explicit (or ExplicitTls in older versions).
https://winscp.net/eng/docs/library_sessionoptions
KindnessHelps

SSH host key fingerprint "sha-rsa 2048 does not match patter

I'm trying to transfer some files using the winscp.dll and receiving an exception on the fingerprint format.

This is the Server Options info I have from the winscp console.
#File transfer protocol = FTP
#Cryptographic protocol = TLS Explicit encryption, TLSv1.2
#Encryption algorithm = TLSv1/SSLv3: RC4-SHA, 2048 bit RSA
#Compression = No
#------------------------------------------------------------
#Certificate fingerprint
#78:b7:ed:6a:2a:6d:06:61:ae:7d:f6:e5:75:7c:0d:68:cc:aa:37:78

Here are some ways I've formatted the statements.
$sessionOptions.SshHostKeyFingerprint = "ssh-dss 2048 78:b7:ed:6a:2a:6d:06:61:ae:7d:f6:e5:75:7c:0d:68:cc:aa:37:78"
$sessionOptions.SshHostKeyFingerprint = "ssh-rsa 1024 78:b7:ed:6a:2a:6d:06:61:ae:7d:f6:e5:75:7c:0d:68:cc:aa:37:78"

This works but throws an error later saying it still needs a key.
$sessionOptions.SslHostCertificateFingerprint = "78:b7:ed:6a:2a:6d:06:61:ae:7d:f6:e5:75:7c:0d:68:cc:aa:37:78"

Not sure what I'm missing!

Thanks for help!