Verifying certificate using crl (Certificate Revoc

2019-06-18 03:38发布

问题:

I want to verify a certificate using CRL attribute. But when I call the verify() method on the certificate after setting flags for CRL checking, then it comes with the following errors.

1) RevocationStatusUnknown => The revocation function is unable to check revocation for the certificate.

2) OfflineRevocation => The Revocation function was unable to check revocation for the certificate because the revocation server was offline...

but the server is ok.

Here's my code for flag settings

X509Chain ch = new X509Chain();
ch.ChainPolicy.RevocationMode = X509RevocationMode.Online;
ch.ChainPolicy.RevocationFlag = X509RevocationFlag.EntireChain;
ch.ChainPolicy.UrlRetrievalTimeout = new TimeSpan(2000);
ch.ChainPolicy.VerificationFlags = X509VerificationFlags.NoFlag;
ch.ChainPolicy.VerificationTime = DateTime.Now;
ch.Build(certificate);

Can not figure out what are the reasons behind this ?