title: PHP Curl & HTTPS not working
body: <p>So im using PHP and Curl trying to download a https weburl (from <a href="https://www.g2crowd.com" rel="nofollow noreferrer">https://www.g2crowd.com</a>) but its not working, here is the code i have so far one simple curl and the other more advanced curl , both are not working sadl. :(</p>
  
  <pre><code>// connect via SSL, but don't check cert
  $ch=curl_init('https://www.g2crowd.com');
  curl_setopt ($ch, CURLOPT_CAINFO, "cacert.pem");
  curl_setopt($ch, CURLOPT_VERBOSE, true);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);  
  
  $content = curl_exec($ch);
  
  echo $content; // show target page
  $ckfile = tempnam ("/tmp", 'cookiename');
  
  $url='https://www.g2crowd.com/';
  //$url='https://www.google.com';
  
  $ch = curl_init();
  curl_setopt( $ch, CURLOPT_COOKIESESSION, true );
  curl_setopt( $ch, CURLOPT_COOKIEJAR, $ckfile );
  curl_setopt( $ch, CURLOPT_COOKIEFILE, $ckfile ); 
  
  curl_setopt($ch, CURLOPT_URL,$url); 
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  
  $headers = [
  'Host: www.g2crowd.com',
  'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0',
  'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  'Accept-Language: en-US,en;q=0.5',
  'Accept-Encoding: gzip, deflate'    
  ];
  curl_setopt($ch, CURLOPT_CAINFO, 'C:\Users\ivan\Downloads\cacert.pem');
  
  curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  curl_setopt($ch, CURLOPT_REFERER, "https://www.g2crowd.com/users/c190d528-ab02-4cb5-8467-9362ceaec290");
  
  curl_setopt($ch, CURLOPT_VERBOSE, true);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  
  $server_output = curl_exec ($ch);
  if(curl_error($ch))
  {
      echo curl_error($ch);
  }
  else {
      echo 'eureka!';
  }
  
  curl_close ($ch);
  </code></pre>
  
  <p>I tried to capture curl error so heres what the error is :</p>
  
  <p>1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version</p>
  
  <p>Please help im really at my wits end! </p>
  
  <p>THank you !!</p>