gpt4 book ai didi

PHP curl 返回 (35) : SSL connect error

转载 作者:太空宇宙 更新时间:2023-11-03 12:56:56 24 4
gpt4 key购买 nike

我正在尝试使用以下代码使用 php curl 7.35.0 访问以下页面:

    $this->ch = curl_init();
curl_setopt($this->ch, CURLOPT_CONNECTTIMEOUT, 3000);
curl_setopt($this->ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36");
curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($this->ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
curl_setopt($this->ch, CURLOPT_TIMEOUT, 3600);
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($this->ch, CURLOPT_URL, 'https://asp.reflexion.net/login');
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
$content = curl_exec($this->ch);
$httpCode = curl_getinfo($this->ch, CURLINFO_HTTP_CODE);
if ($errno = curl_errno($this->ch))
{
$error_message = curl_strerror($errno);
echo "cURL error ({$errno}):\n {$error_message}";
}
echo "<br>";
echo "http code: " . $httpCode . "<br>";
echo "content: " . $content;

返回以下内容:

cURL 错误 (35):SSL 连接错误

http 代码:0内容:

以前有人遇到过这个问题吗?

最佳答案

添加

curl_setopt($this->ch, CURLOPT_SSLVERSION , 3);

解决我的问题。

关于PHP curl 返回 (35) : SSL connect error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26009611/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com