Skip to content

Skipping certificate validation altogether #520

Description

@dkekesi

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)?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionA question about how to do something

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions