由于“Poodle 漏洞”,我的服务器禁用了 SSLv3。
我需要使用 CURL 连接 Clash of Clan API。但我得到的错误是:"error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure"
我尝试使用:
curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, false);
它在我的本地系统上运行良好,但在服务器上运行不正常。
代码
<?php
$curl = curl_init();
curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_URL, 'https://api.clashofclans.com/v1/clans/%23LRQ0PJL9');
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept: application/json','authorization: Bearer XXXXXXXXXXXXXXXXXXX'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$resp = curl_exec($curl);
curl_close($curl);
var_dump($resp);
?>
服务版本:
PHP:
v5.4.42
OpenSSL 详细信息:
OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
curl 详细信息:
curl: no URL specified!
curl: try 'curl --help' for more information
niralvwn@md-17 [/etc]# curl --v
curl: option --v: is ambiguous
curl: try 'curl --help' for more information
niralvwn@md-17 [/etc]# curl -version
curl: no URL specified!
curl: try 'curl --help' for more information
niralvwn@md-17 [/etc]# curl -V
curl 7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Protocols: tftp ftp telnet dict ldap http file https ftps
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz
我是一名优秀的程序员,十分优秀!