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.
Hi Stefan;
This may not be a secure way as the setting is server wide and opens any user to bypass the mail serve exim?
I would prefer using an alternative like csf and tweak as below:
SMTP_BLOCK= 1 () //adds allowed gids to access below port via exim 25,465(implicit tls mail submission ),587(explicit tls on mail submission)
SMTP_ALLOW_LOCAl=1 (allow users to connect to port 25 via scripts but only via exim binary/sendmail symlinked to exim too)
SMTP_PORTS=25,465,57
Not sure if it sorts the specific problem above i would have to test this.