Peer certificate did not match expected
A customer on my server is trying to send email from his website to his email account. For this he's using PHPMailer 6.
Here is the error message he's getting:
I think this has to do with the certificate either not being installed properly, or the certificate is seen as self-signed, neither of which should be true. Going to :2087 shows a secured and working cPanel with a valid cert. He apparently also tried installing WordPress and Gmail SMTP and generated new keys, in order to verify that his implementation of xoauth2 was correct. Same error messages. In order to get it to work at all, he has to bypass SSL certificate validation, which is obviously not a good thing to do. It doesn't help that the documentation on this says "this is implemented for good reason, get your host to fix the configuration."
2017-10-31 14:26:21 Connection failed. Error #2: stream_socket_enable_crypto(): Peer certificate CN=`' did not match expected CN=`smtp.gmail.com' [/home/[CUSTOMER]/public_html/vendor/phpmailer/phpmailer/src/SMTP.php line 404]
SMTP Error: Could not connect to SMTP host.
I think this has to do with the certificate either not being installed properly, or the certificate is seen as self-signed, neither of which should be true. Going to :2087 shows a secured and working cPanel with a valid cert. He apparently also tried installing WordPress and Gmail SMTP and generated new keys, in order to verify that his implementation of xoauth2 was correct. Same error messages. In order to get it to work at all, he has to bypass SSL certificate validation, which is obviously not a good thing to do. It doesn't help that the documentation on this says "this is implemented for good reason, get your host to fix the configuration."
-
Hello, A similiar error message is referenced on the following thread: Issue sending mails through 3rd party In that case, the solution was to disable "WHM >> SMTP Restrictions". Can you check if that helps in this case? Thank you. 0 -
Had the same problem, disabling SMTP restrictions fixed the issue. 0
Please sign in to leave a comment.
Comments
2 comments