Back to product page

HostCertificate method


Called when remote server provides its certificate.

Syntax

  • Basic
object.HostCertificate Owner, Cert, ErrorCode, ErrorText, Accept
The HostCertificate(object,Owner,Cert,ErrorCode,ErrorText,Accept) syntax has these parts:
objectAn expression evaluating to an object of type wodHttpNotify.
OwnerRequired. A wodHttpDLXCom object. Reference to wodHttpDLXCom instance that called this notification method.
CertRequired. An ICertificate object. Reference to object holding server's Certificate.
ErrorCodeRequired. A Long value. Holds error number that occured, if any.
ErrorTextRequired. A String value. Holds test descruption of the error.
AcceptRequired. A Boolean value. When set to False, wodHttpDLX will abort the connection.

Remarks

NOTE: This method is called only if you implemented IwodHttpNotify interface in your application, and wodHttp.Notification property has received reference to instance of your implementation.

Once wodHttpDLX 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.

wodHttpDLX will try to detect if remote certificate should be trusted or not. If any errors are found, ErrorText will contain line-by-line descriptions for all errors found, and ErrorCode will contain first error that was found. If ErrorText is empty (and ErrorCode is 0), certificate should be trusted. wodHttpDLX will load all certificates in your Windows Certificate store (ROOT and MY stores) and remote certificate will be tested against all certificates in those stores.

Even if no error is found - make sure certificate's CommonName property point to the Hostname you're connecting to! This test should be done by your application.

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

Platforms

Windows