title: stream_socket_enable_crypto(): Peer certificate CN=`*.hostingcare.net' did not match expected CN=`mail.domain.com'
body: <p>I am trying to send mail in codeigniter but this error message comes </p>
  
  <blockquote>
    <p>stream_socket_enable_crypto(): Peer certificate CN=<code>*.hostingcare.net' did not match expected CN=</code>mail.domain.com'. </p>
  </blockquote>
  
  <p>I googled this error for long hours but cat find solution.</p>
  
  <p>This is my config setting</p>
  
  <pre><code>$config = array(
      'protocol' =&gt; 'smtp',
      'smtp_host' =&gt; 'mail.domain.com', // changed this
          'smtp_port' =&gt; 587,
          'smtp_user' =&gt; 'info@domain.com',// changed this
          'smtp_pass' =&gt; '*******',// changed this
          'mailtype'  =&gt; 'html',
          'charset'   =&gt; 'utf-8',
      'smtp_crypto'  =&gt; 'tls',
  );
  </code></pre>