title: fsockopen errors with SSL
body: <p>I am trying to use fsockopen on localhost with https on Windows, using Wamp.
  It is working fine on http but not on https.</p>
  
  <p>I created a certificate with OpenSSL (<a href="https://stackoverflow.com/questions/9320529/how-to-install-openssl-wamp">How to install: OpenSSL + WAMP</a>) and declared a virtual host in httpd-vhosts.conf file.</p>
  
  <p>Here is the PHP code:</p>
  
  <pre><code>$fp = fsockopen("ssl://localhost", 443, $errno, $errstr, FSOCKOPEN_TIMEOUT); // same pb with ssl://www.localhost
  </code></pre>
  
  <p>That generates following errors:</p>
  
  <pre><code>PHP Warning:  fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
  PHP Warning:  fsockopen(): Failed to enable crypto
  PHP Warning:  fsockopen(): unable to connect to ssl://localhost:443 (Unknown error)
  </code></pre>
  
  <p>I also have following warning in my ssl error log file when Apache starts (I don't know if it may be related):</p>
  
  <pre><code>[ssl:warn] [pid 6008:tid 596] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
  </code></pre>
  
  <p>Do you have any idea what I did wrong?</p>
  
  <p>Thank you!</p>