stream_socket_enable_crypto(): Peer certificate did not match expected Laravel Error on cPanel

stream_socket_enable_crypto(): Peer certificate did not match expected Laravel Error on cPanel

Here is how to solve the following error in WHM / cPanel:

stream_socket_enable_crypto(): Peer certificate CN=`xxxx.com' did not match expected CN=`smtp.sendgrid.net'

As of PHP 5.6 peer verification is enabled by default (http://php.net/manual/en/migration56.openssl.php).

If you are running WHM / cPanel navigate to WHM and Under Tweak Settings change the “Restrict outgoing SMTP to root, exim, and mailman (FKA SMTP Tweak)” from “On” to “Off”, or navigate to “SMTP Restrictions” and disable it.

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.