Jump to content


Photo

How to create an FTPS connection

ftps

  • Please log in to reply
5 replies to this topic

#1 ole

ole
  • Members
  • 4 posts
  • Gender:
    Male
  • Location:
    Denmark

Posted 03 December 2012 - 12:08 PM

Hello

I have successfully connected to a remote host using the SmartFTP client. The connection is set up as FTPS (Explicit) with anonymous login with a client certificate enabled. All is working well.

However, I have to re-create this scenario using sfFTPLib and am having a hard time reading the c# samples and the documentation as to how to setup the connection. No samples seem to fit my requirements and the documentation leaves me even more confused.

Any starting help would be much appreciated.

Best regards
Ole

#2 mb

mb

    Developer

  • Administrators
  • 11528 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 03 December 2012 - 12:24 PM

What language do you use? C#?

#3 ole

ole
  • Members
  • 4 posts
  • Gender:
    Male
  • Location:
    Denmark

Posted 03 December 2012 - 12:25 PM

C#, yes

vb.net could also do for examples

#4 mb

mb

    Developer

  • Administrators
  • 11528 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 03 December 2012 - 03:38 PM

Please install the latest version of the ftp library:
https://www.smartftp...ftplib/download

It comes with an updated c# sample which shows how to select the protocol and client certificate.

#5 ole

ole
  • Members
  • 4 posts
  • Gender:
    Male
  • Location:
    Denmark

Posted 04 December 2012 - 07:54 AM

Thank you. I will try to work with that.

Please note that the provided C# example doesn't compile, although not tested yet, it should read something like


System.Array certificateThumbprint = Array.CreateInstance(typeof (byte), 20);
certificateThumbprint.SetValue(0x12, 0);
certificateThumbprint.SetValue(0x34, 1);
// etc
_ftp.SSLSocketLayer.ClientCertThumbprint = Convert.ToBase64String((byte[]) certificateThumbprint);

#6 mb

mb

    Developer

  • Administrators
  • 11528 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 04 December 2012 - 09:17 AM

I think you still have the old version of the sfFTPLib.dll or the old interop. ClientCertThumbprint takes now a System.Array in c#, SAFEARRAY(BYTE) in c++.





Also tagged with one or more of these keywords: ftps

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users