PHP 35:错误:14094410:SSL例程:SSL3_READ_BYTES:sslv3警报握手失败 [英] PHP 35: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure
问题描述
cURL停止工作。我开始收到这个错误(它使用工作,直到几个小时前)。
cURL stopped working. I started to get this error (it used work fine till few hours ago).
我使用PHP的cURL扩展。我发现curl命令行的一些解决方案,但不幸的是我不明白他们:/和我不知道如何将他们移动到PHP cURl标志。
I am using cURL extension for PHP. I found some solution for curl command line, but unfortunately i do not understand them :/ and I do not know how to move them to PHP cURl flags.
cURL conf:
cURL conf:
$curl=curl_init();
curl_setopt($curl, CURLOPT_URL, "https://pln.bitcurex.com/data/ticker.json");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSLVERSION, 3);
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_USERAGENT, $this->useragent);
curl_setopt($curl, CURLOPT_VERBOSE, 0);
curl_setopt($curl, CURLOPT_HEADER, FALSE);
curl_setopt($curl, CURLOPT_HTTPHEADER, $this->headers);
if(substr($url, 0, 5)=='https') curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
if($this->ciastko)
{
curl_setopt($curl, CURLOPT_COOKIEJAR, $this->ciastko);
curl_setopt($curl, CURLOPT_COOKIEFILE, $this->ciastko);
}
if($this->post)
{
if( is_array($this->post) && count($this->post) > 0 )
{
$postdata = http_build_query($this->post,'','&');
}
elseif( is_string($this->post) )
{
$postdata = $this->post;
}
else $postdata = '';
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
}
$wynik=curl_exec($curl);
错误:
35: 14094410:SSL例程:SSL3_READ_BYTES:sslv3警报握手失败
35: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure
任何想法如何解决此问题?
any ideas how to fix this?
推荐答案
我知道这是一个有点过时的问题,但我有其他人的解决方案:
I know it's a bit outdated problem, but I've got a solution for others:
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'SSLv3');
这篇关于PHP 35:错误:14094410:SSL例程:SSL3_READ_BYTES:sslv3警报握手失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!