title: Update PHP cURL request from SSLv3 to TLS..?
body: <p>Because of the <a href="https://access.redhat.com/articles/1232123">recent vulnerability discovered in SSLv3</a>, many web service providers (ie. PayPal, Facebook, Google) are disabling that and wanting us to use TLS instead.  I'm having a little bit of trouble figuring out how to do this.</p>
  
  <p>I'm currently using the following function to handle my cURL requests.</p>
  
  <pre><code>function CURLRequest($Request = "", $APIName = "", $APIOperation = "", $PrintHeaders = false)
  {
      $curl = curl_init();
              curl_setopt($curl, CURLOPT_VERBOSE, 1);
              curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
              curl_setopt($curl, CURLOPT_TIMEOUT, 30);
              curl_setopt($curl, CURLOPT_URL, $this-&gt;EndPointURL);
              curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
              curl_setopt($curl, CURLOPT_POSTFIELDS, $Request);
  
      if($this-&gt;APIMode == 'Certificate')
      {
          curl_setopt($curl, CURLOPT_SSLCERT, $this-&gt;PathToCertKeyPEM);
      }
  
      $Response = curl_exec($curl);
  
      /*
       * If a cURL error occurs, output it for review.
       */
      if($this-&gt;Sandbox)
      {
          if(curl_error($curl))
          {
              echo curl_error($curl).'&lt;br /&gt;&lt;br /&gt;';  
          }
      }
  
      curl_close($curl);
      return $Response;   
  }
  </code></pre>
  
  <p>When I try hitting PayPal's sandbox, though, where they've already disabled this, I end up with a cURL error:  <em>error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure</em></p>
  
  <p>The info that I've found is that I just need to change this to use TLS instead of SSL, and the other answers I've seen say to simply do that by adding a curl option to my function...</p>
  
  <pre><code>curl_setopt($curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
  </code></pre>
  
  <p>I've added that option, though, and I still get the exact same result.  Any information on how I can get this working would be greatly appreciated.  Thanks!</p>