title: PHPMailer SMTP localhost, certificate error
body: <p>We use PHPMailer. The server is configured to use the local SMTP. 
  So, the general PHPMailer commando looks like this:</p>
  
  <pre><code>$mail = new PHPMailer();
  $mail-&gt;From = 'info@localdomain.com';
  $mail-&gt;Host = 'localhost';
  $mail-&gt;IsSMTP();
  ...
  </code></pre>
  
  <p>Since PHP5.6, this doesn't work anymore, because the certificate does not match. We get the following error:</p>
  
  <blockquote>
    <p>Warning: stream_socket_enable_crypto(): Peer certificate
    CN='*.thisvps.com' did not match expected CN='localhost' in /ho...PHPMailer_latest/class.smtp.php</p>
  </blockquote>
  
  <p>I can suppress this error using:</p>
  
  <pre><code>$this-&gt;smtpConnect([
     'ssl' =&gt; [
         'verify_peer' =&gt; false,
         'verify_peer_name' =&gt; false,
         'allow_self_signed' =&gt; true
     ]
  ]);
  </code></pre>
  
  <p>But, is that the correct way to go? I'm not a big fan of suppressing errors;).
  Or maybe there is an error in our configuration?</p>
  
  <p>Version info:
  PHP 5.6.30,
  PHPMailer: 5.2.21</p>
  
  <p>Any suggestion are welcome, thanks in advance! </p>