Error when trying to authenticate through smtp

edited February 24 in Email

I have some forms to authenticate through smtp:

smtp.emailsrvr.com
secure.emailsrvr.com

They were working but now getting an error. I think maybe a firewall issue?

Warning: stream_socket_enable_crypto(): Peer certificate CN=secure.emailsrvr.com' did not match expected CN=smtp.emailsrvr.com' in /home/sitename/public_html/wp-includes/class-smtp.php on line 344

Comments

  • edited February 24

    Hello,

    That error is indicating that a certificate with the name secure.emailsrvr.com' was expected, but a certificate with a name `smtp.emailsrvr.com was used or received. This issue would have to be resolved in the site code by a developer. Please let us know if there is anything else that we can assist with.

  • I understand but I think this is something to do with a setting on whm as it was working and now it is not for all sites:

    It seems to timeout: 2016-05-18 19:23:00 Connection: opening to ssl://secure.emailsrvr.com:465, timeout=300, options=array ( )

  • Hi,

    You need to configure your scripts that are connecting to SMTP to connect using the common name of the certificate that is in use on secure.emailsrv.com. According to the error message, that means you need to connect to "secure.emailsrvr.com" instead of "smtp.emailsrvr.com"

    Please let me know if you have any other questions.

  • I have put it back to secure.emailsrvr.com but when I try and connect to secure.emailsrvr.com I get an instant timeout. When I run this script on another server, it works fine.

    I am trying to tracert but it says the command is not found although active on whm. Do I need to reboot server?

  • Hi,

    What port is your script trying to connect out on?

  • Right now I have it on: 465

  • Could port 465 not be blocked in your firewall?

  • Thanks that worked. How and when did this start getting blocked?

  • It may have been closed since CSF was initially installed. If you manually whitelisted the IP that smtp.emailsrvr.com, that would have worked around the actual port being blocked.

    465 is a very common port for outgoing SMTP with SSL, so it is better to just open up the port. There is no security risk in doing so.

This discussion has been closed.