美文网首页php
跳过ssl和443请求

跳过ssl和443请求

作者: 落魄PHP女程序员 | 来源:发表于2018-08-16 18:27 被阅读0次

    function BaijiesudaiCurl($url,$post_data=null){

          $headers = ['Content-Type:'.'application/json;charset=UTF-8'];

          $ch = curl_init();

          curl_setopt($ch, CURLOPT_POST, 1);

          curl_setopt($ch, CURLOPT_HEADER, 0);

          curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

          // //http://192.168.0.51:8081/insurance/callBack白洁测试白洁测试地址没钞蜂

          curl_setopt($ch, CURLOPT_URL,$url);

          curl_setopt($ch, CURLOPT_POSTFIELDS,json_encode($post_data));

          curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);//绕过ssl验证

          curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

          curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

          $result = curl_exec($ch);

          curl_close($ch);

          return $result;

      }

    相关文章

      网友评论

        本文标题:跳过ssl和443请求

        本文链接:https://www.haomeiwen.com/subject/abiobftx.html