title: how to fix stream_socket_enable_crypto(): SSL operation failed with code 1
body: <pre><code>stream_socket_enable_crypto(): SSL operation failed with code 1. 
  OpenSSL Error messages: error:14090086:SSL 
  routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
  </code></pre>
  
  <p>Im using Laravel 4.2, PHP 5.6, Apache 2.4</p>
  
  <p>I have GoDaddy SSL installed in Amazon ec2 Linux.</p>
  
  <p>SSL working fine when i visit the site with https.</p>
  
  <p>The error happened when I call my function :</p>
  
  <pre><code>&lt;?php
  
  public function sendEmail() 
  {
          \Mail::send ( 'emails.code.code', $data, function ($sendemail) use($email) {
              $sendemail-&gt;from ( 'info@me.com', 'Me Team' );
              $sendemail-&gt;to ( $email, '' )-&gt;subject ( 'Activate your account' );
          } );
  
  }
  ?&gt;
  </code></pre>
  
  <p>I read some articles about this, they said that there are things we should make some changes, they put that code but i don't know where to insert it.</p>
  
  <p>Been reading this: <a href="https://www.mimar.rs/en/sysadmin/2015/php-5-6-x-ssltls-peer-certificates-and-hostnames-verified-by-default/" rel="noreferrer">https://www.mimar.rs/en/sysadmin/2015/php-5-6-x-ssltls-peer-certificates-and-hostnames-verified-by-default/</a></p>
  
  <p>and this documentation of php <a href="http://php.net/manual/en/migration56.openssl.php" rel="noreferrer">http://php.net/manual/en/migration56.openssl.php</a> which is hard to understand.</p>
  
  <p>So my question is how to solve this problem?</p>