I was pulling my inboxes using php-imap/php-imap library and inboxes managed by CPanel. All in sudden script stopped with following error.
Connection error: Certificate failure for imap.domain.com:
Server name does not match certificate:
/OU=Domain Control Validated/OU=PositiveSSL/CN=<amazon.domain.com>
in /.../vendor/php-imap/php-imap/src/PhpImap/Mailbox.php
here is the imap path I am using:
{imap.domain.com:143/imap/tls}INBOX
I also tried {imap.domain.com:143/novalidate-cert/imap/tls}INBOX
but all in vain.
What change could have have stopped it?
How to fix it and avoid such failure in future?