Certificate error while sending an email

0

Hello, yesterday when sending an email through my website and my client created by wordpress, I encountered an error sending the email:

Warning:  stream_socket_enable_crypto(): Peer certificate CN='*.locaweb.com.br' did not match expected CN='smtp.toldosmaranata.com.br' in /home/storage/2/f3/41/toldosmaranata/public_html/wp-includes/class-smtp.php on line 367

I did some research but could not identify how to solve this problem that is in the class of smtp in line 367 that I will insert here also to facilitate:

365        if (!stream_socket_enable_crypto(
366            $this->smtp_conn,
367            true,
368            $crypto_method
369        )) {
370            return false;
371        }
372        return true;
373    }

Thank you in advance for your help, thank you!

    
asked by anonymous 15.05.2017 / 18:51

1 answer

1

In the class.phpmailer.php file on line 275 switch from:

public $SMTPOptions = array();

for public

$SMTPOptions = array('ssl'=> array('verify_peer'=>false,
                                   'verify_peer_name' => false, 
                                   'allow_self_signed' => true ) );

This will disable ssl certificate verification. Just do this if you are sure that the server on which you are sending your emails is safe.

    
17.05.2017 / 15:06