title: How to get PHP to connect to TLSv1.2 only site
body: <p>I'm trying to connect using curl in PHP to <a href="https://secure.prontocycleshare.com/data/stations.json" rel="nofollow">Pronto Cycle Share</a> (using PHP 5.6.2). This site works in the browser and from command line curl.</p>
  
  <p>According to <a href="https://www.ssllabs.com/ssltest/analyze.html?d=secure.prontocycleshare.com&amp;s=67.22.239.200" rel="nofollow">SSL Labs</a>, it is only accepting TLS 1.2.</p>
  
  <p>In PHP, using CURL (version 7.28.1) PHP fails to negotiate and gives me <code>Curl error: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure</code></p>
  
  <p>Using file_get_contents, the code:</p>
  
  <pre><code>$ctx = stream_context_create([
  'ssl' =&gt; [
      'crypto_method' =&gt; STREAM_CRYPTO_METHOD_TLS_CLIENT
    ],
  ]);
  $html = file_get_contents($url, false, $ctx);
  </code></pre>
  
  <p>Returns:</p>
  
  <pre><code>Message:  file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
  </code></pre>
  
  <p><code>print_r(OPENSSL_VERSION_TEXT)</code> says OpenSSL 0.9.8r 8 Feb 2011, so that's fairly old. I'm using MAMP PRO on the Mac.</p>
  
  <p>Is there any way to connect to this server using simple PHP methods?</p>