Re: wodFtpDLX Hostcertificate event with FileZilla - WeOnlyDo Discussion board

Re: wodFtpDLX Hostcertificate event with FileZilla (General questions)

by woddrazen, Wednesday, September 30, 2009, 21:09 (5315 days ago) @ newP

Hi,


Server certificate is accepted automatically. If you don't add any code inside wodFtpDLX HostCertificate Event.

Can we maybe duplicate your problem with file transfer? File transfer should work. Did you try to transfer file with some other FTPS client maybe?

HostCertificate Event fires when remote server provides its certificate. I'm not sure what exactly you want to do inside HostCertificate Event.

You can show server certificate in HostCertificate Event to user using Certificate Show Method.
[code]Cert.Show ( Server cert )[/code]

If you want to save certificate you can use Certificate Save Method.
[code]Cert.Save ( c:\cert.cer )[/code]

If you want to check server certificate when user next time try to connect to that server using wodFtpDLX, you can compare locally saved server certificate (which can be saved using cert.Save in HostCertificate Event) and one that server provide.

To do that you can compare server certificate public key in HostCertificate Event with one saved locally.
[code]Dim cert_local As Certificate
Set cert_local = New Certificate

cert_local.Load c:\cert.cer

If cert_local.PublicKeyOpenSSH = cert.PublicKeyOpenSSH Then
Accept = True
Else
MsgBox Wrong certificate
Accept = False
End If[/code]
This is VB6 code but you can easily convert it to VC++. If you have some problem let us know and we will try to help you.

Hope this helps.


Regards,
Drazen


Complete thread: