title: PHP Curl Error when using SSL
body: <p>I am trying to use the WHMCS API to connect a third party script to it. I have created the third party's script as follows, however, when I try to connect to my site using HTTPS, I get this error: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol</p>
  
  <p>If I use HTTP, I get a 404 error. The code is as follows (and yes, that is my actual domain, since I figured the SSL's specifics might matter):</p>
  
  <pre><code>$email = $_GET["email"];
  $password = $_GET["password"];
  if(filter_var($email, FILTER_VALIDATE_EMAIL) &amp;&amp; strlen($password) &gt; 0) {
      $postfields["username"] = $apiusername;
      $postfields["password"] = $apipassword;
      $postfields["action"] = "validatelogin";
      $postfields["email"] = $email;
      $postfields["password2"] = $password;
  
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, "https://tfdidesign.com/accounts/includes/api.php");
      curl_setopt($ch, CURLOPT_POST, 1);
      curl_setopt($ch, CURLOPT_TIMEOUT, 100);
      curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);   
      curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
      $data = curl_exec($ch);
      if(curl_error($ch))
          echo(curl_error($ch));
      curl_close($ch);     
      $data = explode(";",$data);
      foreach ($data AS $temp) {
          $temp = explode("=",$temp);
          $results[$temp[0]] = $temp[1];
      }
  }
  else
      die("INVALID_CREDENTIALS");
  </code></pre>