title: cURL fails with error: Couldn't understand the server certificate format
body: <p>Mac OSX El Capitan, default apache install on localhost, brew installed php70. The following code works using cli (php -f test.php), but when run from apache I get the following.</p>
  
  <pre><code>SSL certificate problem: Couldn't understand the server certificate format
  </code></pre>
  
  <p>Using "http" URLs works fine in both. Same setup on a Ubuntu machine works fine. I had this working before doing a clean install of El Capitan and I vaguely remember something about Mac OSX and openssl for curl but can't find the difference here.</p>
  
  <pre><code>$curl = curl_init();
  
  curl_setopt_array($curl, array(
    CURLOPT_URL =&gt; "https://api.example.com/",
    CURLOPT_RETURNTRANSFER =&gt; true,
    CURLOPT_ENCODING =&gt; "",
    CURLOPT_MAXREDIRS =&gt; 10,
    CURLOPT_TIMEOUT =&gt; 30,
    CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST =&gt; "GET",
    CURLOPT_HTTPHEADER =&gt; array(
      "cache-control: no-cache"
    ),
  ));
  
  $response = curl_exec($curl);
  $err = curl_error($curl);
  
  curl_close($curl);
  
  if ($err) {
    echo "cURL Error #:" . $err;
  } else {
    echo $response;
  }
  </code></pre>