dp7311 2014-11-20 07:58
浏览 252
已采纳

CURL获取错误:14094410:SSL

This is my code. Am trying get information from a server.

But I got stuck in the middle. Please help me.

Am getting error such as

[errors] => Array ( [0] => error:14094410:SSL 
                 routines:SSL3_READ_BYTES:sslv3 alert handshake failure ) ) 

Below is the code that I have written please check and help me. Will appreciate any help.

public function get_quotes(){
     $reservation_obj->source = "test";
     $reservation_obj->location_code = "test";
     $reservation_obj->start_date = "2010-06-01 19:00";
     $reservation_obj->end_date = "2010-06-04 13:50";


     $reservation_obj->action = "get_quotes";
     $json = json_encode($reservation_obj);
     $curl_opts = array(
     CURLOPT_HEADER => false,
     CURLOPT_HTTPHEADER => array('Content-Type: text/json', 'Content-length: '.strlen($json)),
     CURLOPT_POST => true,
     CURLOPT_POSTFIELDS => $json,
    CURLOPT_RETURNTRANSFER => true,
     CURLOPT_URL => "https://myserver/test.php",
     CURLOPT_VERBOSE => false,
     CURLOPT_SSLCERT => getcwd()."/newfile.crt.pem",
     CURLOPT_SSLCERTTYPE => "PEM",
     CURLOPT_SSLKEY=> getcwd()."/newfile.key.pem",
     CURLOPT_SSLKEYTYPE => "PEM",
     CURLOPT_SSL_VERIFYHOST => false,
     CURLOPT_SSL_VERIFYPEER => false,
     CURLOPT_SSLVERSION => 3
     );

     $curl = curl_init();
     curl_setopt_array($curl, $curl_opts);
     if(!$response = curl_exec($curl)){
     $response->errors[] = curl_error($curl);
     }
     curl_close($curl);

     if(count($response ->errors)){
      print_r($response);
     }else{

     print_r($response);

     }

     }
  • 写回答

1条回答 默认 最新

  • douye9822 2014-11-20 08:40
    关注

    comment out the CURLOPT_SSLVERSION => 3 line and try again.

    They say the SSL v3 is vulnerable (idk much about that, sorry), so many of the servers do not allow it using the v3.

    Here is an article if you are interested. https://access.redhat.com/articles/1232123

    Please let me know the result after you try it. thanks.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化
  • ¥15 Mirare PLUS 进行密钥认证?(详解)
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥20 想用ollama做一个自己的AI数据库
  • ¥15 关于qualoth编辑及缝合服装领子的问题解决方案探寻
  • ¥15 请问怎么才能复现这样的图呀