I have an application that sits behind a firewall with no internet access. When I connect to an IMAPS server that has a certificate issued by VeriSign, MailKit will go and try to retrieve certificate revocation information (CRL or OCSP), but it will obviously fail.
I use this method to ignore certificate errors:
client.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => { return true; };
While this will indeed prevent exceptions caused by lack of CRL/OCSP access, there's a major issue with the approach. This callback only processes the results of certificate validation, thus making me wait for the timeout while the server tries to retrieve revocation data. It is around 1 minute by default, which is a real pain to wait at every connection attempt.
Is there a way to tell MailKit to skip certificate validation altogether, without even trying to do anything (especially going online)?
I have an application that sits behind a firewall with no internet access. When I connect to an IMAPS server that has a certificate issued by VeriSign, MailKit will go and try to retrieve certificate revocation information (CRL or OCSP), but it will obviously fail.
I use this method to ignore certificate errors:
client.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => { return true; };While this will indeed prevent exceptions caused by lack of CRL/OCSP access, there's a major issue with the approach. This callback only processes the results of certificate validation, thus making me wait for the timeout while the server tries to retrieve revocation data. It is around 1 minute by default, which is a real pain to wait at every connection attempt.
Is there a way to tell MailKit to skip certificate validation altogether, without even trying to do anything (especially going online)?