【发布时间】:2013-08-14 00:58:55
【问题描述】:
我正在尝试执行 HTTPS 请求:
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);
请求后,$out 为空,我得到了这个日志:
* 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
为什么?
【问题讨论】:
-
你的 php 和 openssl 平台和版本是什么?检查
phpinfo(); -
Google 上的第一次点击 指向 SO 上的一个问题,该问题解释了为什么会发生这种情况:stackoverflow.com/questions/8619706/… - 糟糕的研究如何。
-
@fvu,谢谢,curl_setopt($ch, CURLOPT_SSLVERSION,3);为我工作。
-
@Waygood,PHP 5.4.10,OpenSSL/0.9.8x,Mac OS X 10.8.4