我正在尝试将 curl 请求发送到另一个域,返回
ssl 连接错误,错误号。35 在 hostgator 上。
代码:
$url= $endpoint . "?".http_build_query($data);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_FORBID_REUSE, 1);
curl_setopt($curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
$res = curl_exec($curl);
if(curl_error($curl))
{
echo curl_errno($curl);
echo 'error:' . curl_error($curl);
}
此问题特定于 hostgator
请让我知道如何摆脱 ssl 错误