1

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.

Sam
  • 7,252
  • 16
  • 46
  • 65
S.Sire
  • 27
  • 1
  • 3
  • 9

1 Answers1

4

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.

Community
  • 1
  • 1
pepo
  • 8,644
  • 2
  • 27
  • 42
  • 2
    Thanks pepo for you answer. With CAPI2 I get the following new exception: The certificate's CN name does not match the passed value I thought with delegate { return true; }; the error couldn't happen. I can change nothing on the server so I have to fix the problem in the app. Any further ideas to fix it? – S.Sire Apr 07 '17 at 22:05
  • 1
    You are calling a different url (or IP?) than is in the certificate either in CN or Subject Alternative Name. If so then change the url. – pepo Apr 07 '17 at 22:12