PHP Curl: SSL routines:SSL23_GET_SERVER_HELLO:reas

2019-02-12 17:08发布

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?

标签: php curl ssl https
2条回答
手持菜刀,她持情操
2楼-- · 2019-02-12 17:48

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

查看更多
霸刀☆藐视天下
3楼-- · 2019-02-12 17:58

Fix:

curl_setopt($ch, CURLOPT_SSLVERSION,3); 
查看更多
登录 后发表回答