title: cURL Unsupported SSL Protocol
body: <p>I have a cURL request that fails when running it through my PHP 5.4.48 app. Funny thing is, it executes correctly when running it directly through the console, or through Postman.</p>
  
  <p>The API I'm connecting to expects a TLSv1.2 connection, which I am specifying in my app.</p>
  
  <p>Here's my simple request as it is in my PHP app:</p>
  
  <pre><code>$ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, 'https://dev-dataconnect.givex.com:50104');
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS,$payload);
  
  curl_setopt($ch, CURLOPT_POST, 1 );
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/plain;charset=UTF-8')); 
  curl_setopt($ch, CURLOPT_SSLVERSION, 6);
  // curl_setopt($ch, CURLOPT_SSLVERSION, 'CURL_SSLVERSION_TLSv1_2'); // specifying value by name was of no help
  curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'TLS_RSA_WITH_AES_256_CBC_SHA256');
  
  curl_exec($ch);
  </code></pre>
  
  <p>A raw cURL request would look like this (note this fires successfully from within the console)</p>
  
  <pre><code>curl 'https://dev-dataconnect.givex.com:50104/' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36' -H 'Content-Type: text/plain;charset=UTF-8' -H 'Accept: */*' -H 'Cache-Control: no-cache' -H 'Connection: keep-alive' --data-binary $'{"method":"dc_909","id":"confidential","jsonrpc":"2.0","params":["en","confidential","29530","confidential"]}\n' --compressed
  </code></pre>
  
  <p>Also note I didn't need to specify the SSL Version for a successful handshake</p>
  
  <p>Here's the printout from running curl -v '<a href="https://dev-dataconnect.givex.com:50104/" rel="nofollow">https://dev-dataconnect.givex.com:50104/</a>'</p>
  
  <pre><code>* Connected to dev-dataconnect.givex.com (72.15.49.106) port 50104 (#0)
  * TLS 1.2 connection using TLS_RSA_WITH_AES_256_CBC_SHA256
  * Server certificate: *.givex.com
  * Server certificate: Trustwave Organization Validation SHA256 CA, Level 1
  * Server certificate: SecureTrust CA
  &gt; GET / HTTP/1.1
  &gt; Host: dev-dataconnect.givex.com:50104
  &gt; User-Agent: curl/7.43.0
  &gt; Accept: */*
  </code></pre>
  
  <p>I'm running </p>
  
  <pre><code> - PHP 5.4.48
   - curl 7.43.0 (within both my MAMP and my Mac environments)
   - OpenSSL/0.9.8zd (within both my MAMP and my Mac environments)
  </code></pre>
  
  <p>I've been troubleshooting this issue since last week. Any ideas???</p>