duanbushi1479 2014-09-24 06:01
浏览 186

PHP curl返回(35):SSL连接错误

Im trying to visit the following page using php curl 7.35.0 using the following code:

    $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}):
 {$error_message}";
    }
    echo "<br>";
    echo "http code: " . $httpCode . "<br>";
    echo "content: " . $content;

Which returns the following:

cURL error (35): SSL connect error

http code: 0 content:

Did anyone run into this problem before?

  • 写回答

4条回答 默认 最新

  • dqtu14636 2014-10-09 04:48
    关注

    Adding

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

    solve my issue.

    评论

报告相同问题?

悬赏问题

  • ¥15 把Excel导入MATLAB显示错误怎么解决?
  • ¥15 Java中消息和缓存如何使用
  • ¥50 易语言把MYSQL数据库中的数据添加至组合框
  • ¥20 求数据集和代码#有偿答复
  • ¥15 关于下拉菜单选项关联的问题
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx