Search code examples
c#ssl.net-4.5imapservicepointmanager

the remote certificate is invalid according to the validation procedure using imap


I wrote a NET 4.5 client application tool using an IMAP require and a SMTP send command.

Now my current issue is I get the following exception at one client:

the remote certificate is invalid according to the validation procedure

I changed the code to:

ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

So all certificates should be accepted. The server needs SSL. The same connection information is working with outlook or thunderbird without errors.


Solution

  • It could be something with trust issues like missing root CA or intermediate on client/server.

    These validation issues can be logged (if you enable it) to CAPI2 event log. This answer might help you.