Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Curl: SSL routines:SSL23_GET_SERVER_HELLO:reason(1112)

Tags:

php

curl

https

ssl

I'm trying to execute HTTPS request:

curl_setopt($curl, CURLOPT_URL, 'https://***.com');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_POST, false);
curl_setopt($curl, CURLOPT_COOKIEJAR, $cookiesFile);
curl_setopt($curl, CURLOPT_VERBOSE, true);
$out = curl_exec($curl);

After request, $out is empty, and I'm getting this log:

* About to connect() to ***.com port 443 (#0)
*   Trying *.*.*.*...
* connected
* Connected to ***.com (*.*.*.*) port 443 (#0)
* error:14077458:SSL routines:SSL23_GET_SERVER_HELLO:reason(1112)
* Closing connection #0

Why?

like image 845
artem Avatar asked Aug 12 '13 16:08

artem


2 Answers

Fix:

curl_setopt($ch, CURLOPT_SSLVERSION,3); 
like image 186
artem Avatar answered Oct 31 '22 00:10

artem


If you're using PRTG and get this error, go to settings and change from "SSL V2 or V3" to "SSL V3".

like image 27
Josiah Avatar answered Oct 31 '22 00:10

Josiah