title: file_get_contents + stream_context_create works on 1 server, blocked on another
body: <p>We have 2 servers, dev and live. They both use LAMP (Debian), but the dev server is regular http and the live server is https. This code works perfectly on our dev server:</p>
  
  <pre><code>$all_data = array(...);
  $eol = "\r\n";
  
  $headers = array(
      'Content-Type: application/json',
      'Content-Length: ' . strlen(json_encode($all_data)),
      'connection: close'
  );
  $headers = implode($eol, $headers);
  
  $opts = array(
      'http'=&gt;array(
          'method' =&gt; 'POST',
          'header' =&gt; $headers,
          'content' =&gt; json_encode($all_data)
      )
  );
  $context = stream_context_create($opts);
  
  
  $update_data = file_get_contents($_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'] . $system_file, null, $context);
  </code></pre>
  
  <p>On the live server, the file_get_contents gives this error:</p>
  
  <pre><code>Warning: file_get_contents(https://...): failed to open stream: Connection timed out in ....php on line 1086
  </code></pre>
  
  <p>I have looked at the apache logs for clues as to what is causing it to fail on the live server, but I only see the error above. It doesn't say what's blocking the call. I have allow_url_include and allow_url_fopen set to On on the live server. </p>
  
  <p>I don't know if it's something in the Apache configuration or the SSL configuration, or something else, and I don't know where to look. I spent several hours today researching this issue and tried adding different headers to the headers array (User-Agent, Accept-Language, Accept-Encoding, Cookie, etc.), but nothing worked. I basically tried to replicate what was on dev, but live just didn't like it.</p>
  
  <p>I also verified that if I copy and paste the URL that's being created directly in the browser that it works, so I know the filename is correct. </p>
  
  <pre><code> dev server:
   php: 5.6.14-0+deb8u1
   apache: Apache/2.4.10
   debian: 8.2
  
   live server:
   php: 5.5.12
   apache: Apache/2.4.10
   debian: 7.9
  </code></pre>