title: file_get_contents(): SSL operation failed with code 1 (certificate verify failed)
body: <p>I have installed WAMP 3.0.4 and am trying to write a PHP script that connects to an external HTTPS web service. But this returns the error:</p>
  
  <blockquote>
    <p>Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed</p>
  </blockquote>
  
  <p>I have written a short script that demonstrates the issue:</p>
  
  <pre><code>&lt;?php
  $auth = base64_encode('username:password');
  
  $aContext = array(
      'http' =&gt; array(
          'proxy' =&gt; 'tcp://proxyip:proxyport',
          'request_fulluri' =&gt; true,
          'header' =&gt; 'Proxy-Authorization: Basic $auth'
      ),
      'SSL' =&gt; array(
          'verify_peer' =&gt; false,
          'verify_peer_name' =&gt; false,
          'allow_self_signed' =&gt; true,
          'cafile' =&gt; 'C:/wamp/certificates/cacert.pem'
      )
  );
  $cxContext = stream_context_create($aContext);
  
  $sFile = file_get_contents("https://www.google.com", False, $cxContext);
  
  echo $sFile;
  ?&gt;
  </code></pre>
  
  <p>It is a requirement to use a proxy server.</p>
  
  <p>As can be seen, I have tried installing a root certificates bundle and also adding verify_peer to false (not that I would do that in production) but still I receive this error.</p>
  
  <p>As can be clearly seen from the above, I am something of an Apache / WAMP novice. Can someone perhaps explain what I am missing?</p>