1

Am using CURL to get the XML response in PHP. The problem is when I run the PHP cron job file, It didn't get the response.

$ch = curl_init($URL);
curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HEADER, true);     
curl_setopt($ch, CURLOPT_PORT, 80);

$responseAll = curl_exec($ch);

When I run the CURL in command prompt I get the response

CURL -Li <URL>

But the problem is when I run this as a PHP file, the curl throws the error as

35 SSL Connect error

Note: Also the same works fine in PHP4. The problem occurs only in PHP5

hakre
  • 193,403
  • 52
  • 435
  • 836
Coder
  • 253
  • 8
  • 17
  • Related: [curl errno 35 (Unknown SSL protocol error in connection to \[secure site\]:443)](http://stackoverflow.com/questions/4073404/curl-errno-35-unknown-ssl-protocol-error-in-connection-to-secure-site443) - Please report this back to the administrator of your server. There might be a problem with the SSL libraries used by the curl bindings in PHP. If you google for the curl error number you see a lot of system-configuration related threads. This can not be easily solved with passing an options or writing a line of PHP code. – hakre Mar 20 '13 at 09:57
  • This might be helpful: http://matt.thomm.es/archive/2012/10/26/php-curl-error-ssl-connect-error At least it helped me to fight the same problem, if this is the solution, I can make it an answer to accept. – Nemoden Jun 21 '13 at 01:30

0 Answers0