Post a reply

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


I figured it out. For anyone who may be having a similar problem, the answer is below.

First of all, the actual correct command line should've been:
open ftps:// -explicittls -hostkey="01:02:03:04:05:06:07:08:09:10:11:12:13:14:15:16:17:18:19:20" -passive

It should have been using explicitTLS on the command line, but it seemed to work with either. That was my mistake. This key is 20 pairs long, which is TLS it seems, rather than the slightly shorter SSL key.

What finally worked was using:
Protocol = FTP
FTPSMode = ExplicitTLS
TLSHostCertificateFingerprint = "01:02:03:04:05:06:07:08:09:10:11:12:13:14:15:16:17:18:19:20"

That combination of settings successfully made my connection. Thanks to anyone who checked out this topic. This is a great library.

C# having trouble using hostkey

I'm able to use WinSCP's library to do standard FTP, but when I'm trying to connect to a particular server, I'm having trouble figuring out how to set the SessionOptions. The command line that I use to connect successfully is as follows:
open ftps:// -explicitssl -hostkey="01:02:03:04:05:06:07:08:09:10:11:12:13:14:15:16:17:18:19:20" -passive

I'm unable to figure out the correct mix of SessionOptions to make this work, however. How would I set the PROTOCOL, FTPSMODE, and SSHHOSTKEYFINGERPRINT?

I've tried several different combinations, but always run into one error or another no matter what combination I've tried. I've gotten all of the below errors in my attempts, but I can't quite figure out how to set my SessionOptions. Can anyone help? Thanks so much!
SSH host key fingerprint "myfingerprint" does not match 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})*/

SessionOptions.FtpSecure is not FtpSecure.None, but SessionOptions.Protocol is not Protocol.Ftp.

SessionOptions.TlsHostCertificateFingerprint or SessionOptions.GiveUpSecurityAndAcceptAnyTlsHostCertificate is set, but SessionOptions.FtpSecure is FtpSecure.None.