Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skipping certificate validation altogether #520

Closed
dkekesi opened this issue Jun 9, 2017 · 5 comments
Closed

Skipping certificate validation altogether #520

dkekesi opened this issue Jun 9, 2017 · 5 comments
Labels
question A question about how to do something

Comments

@dkekesi
Copy link

dkekesi commented Jun 9, 2017

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

@jstedfast jstedfast added the question A question about how to do something label Jun 10, 2017
@jstedfast
Copy link
Owner

Is there a way to tell SslStream to skip validation? I haven't seen one. So.... no.

@jstedfast
Copy link
Owner

Found a way.

@dkekesi
Copy link
Author

dkekesi commented Jun 10, 2017

Wow, that was fast. Thanks a million. This is EXACTLY why MailKit/MimeKit is the best. Period.

@dkekesi
Copy link
Author

dkekesi commented Jun 30, 2017

Do you plan to make a new release that contains this feature in the near future? Thanks.

@jstedfast
Copy link
Owner

Yes. I'm hoping to make a release this weekend but I'm waiting on some feedback on some patches for NTLM fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A question about how to do something
Projects
None yet
Development

No branches or pull requests

2 participants