Back to product page

HostCertificateEvent event


Fires when remote FTPS server provides his certificate.

Syntax

  • C#
  • VB.NET
delegate void HostCertificateDelegate(object Sender, HostCertificateArgs Args);
The HostCertificateEvent(Args.Accept,Args.Certificate,Args.ErrorCode,Args.ErrorText) syntax has these parts:
Args.AcceptBoolean. Determines if you will accept server's certificate.
Args.CertificateX509Certificate object. Holds server's certificate.
Args.ErrorCodeSslPolicyErrors enumeration. Certificate error code.
Args.ErrorTextString. Text description of certificate errors, if any. If more than one, they are stored one error per line

Delegate Sub HostCertificateDelegate(ByVal Sender As Object, ByVal Args As HostCertificateArgs)
The HostCertificateEvent(Args.Accept,Args.Certificate,Args.ErrorCode,Args.ErrorText) syntax has these parts:
Args.AcceptBoolean. Determines if you will accept server's certificate.
Args.CertificateX509Certificate object. Holds server's certificate.
Args.ErrorCodeSslPolicyErrors enumeration. Certificate error code.
Args.ErrorTextString. Text description of certificate errors, if any. If more than one, they are stored one error per line

Remarks

Once wodFtpDLX.NET connects to SSL/TLS server, it will receive server's certificate that holds information about server's validity. It will contain information such as server's name, organization, valid dates etc.. Certificates are usually signed by some known CA (Certificate Authority) whose responsibility is to prove that server is really the one he's representing to be.

wodFtpDLX.NET will try to detect if remote certificate should be trusted or not. If any errors are found, Args.ErrorText will contain line-by-line descriptions for all errors found, and Args.ErrorCode will contain enumeration of errors that were found. If Args.ErrorText is empty (and Args.ErrorCode is 0), certificate should be trusted.

If you think remote server's certificate is invalid, you should set Args.Accept parameter to False and wodFtpDLX.NET will immediately close the connection.

Platforms

Windows