Discuss this help topic in SecureBlackbox Forum
Use this method to check validity of the certificates received from the remote party in SSL/TLS communication.
Declaration
Parameters
Host roles
|
Validity values
|
Validity reasons
|
Description
Use this method to validate the certificate received during SSL / TLS handshake (e.g., via OnCertificateValidate event of SSL components). You need to pass the end-entity certificate only - CA certificates will be retrieved via Certificate's Chain property. So the event handler for OnCertificateValidate should look like this (in pseudocode):
if (Certificate.Chain = null) or (Certificate.Chain.Certificates[0] = Certificate) then
Validator.ValidateForSSL(Certificate, …)
If the chain is not available, you can pass CA certificates via AdditionalCertificates parameter or using AddKnownCertificates() method.
The method checks whether the certificate subject and names correspond to given domain name or IP address. Next certificate's Key Usage fields are checked to ensure that the certificate may be used for TLS handshake. Finally, Validate() method is called to validate the certificate itself.
Domain name and IP address of the other party can be obtained via RemoteHost and RemoteIP properties of SSL classes (TElHTTPSClient, TElSimpleFTPSClient, TElSMTPClient).
When CompleteChainValidation = true and the certificate is found to be not valid, certificate validation continues, i.e. issuer (CA) certificates are validated as well. This lets you create validation report which should include all certificates in the chain. When CompleteChainValidation = false and the certificate is not valid, further validation is not performed and Validate() method returns immediately.
Since version 13 ResetCertificateCache parameter has been replaced with ResetCertificateCache class method.