Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
发送请求Web服务时PHP中出现Curl错误56_Php_Ssl_Curl - Fatal编程技术网

发送请求Web服务时PHP中出现Curl错误56

发送请求Web服务时PHP中出现Curl错误56,php,ssl,curl,Php,Ssl,Curl,我通过SOAP向具有自签名证书的Web服务发送一个请求,为此我应用了以下函数以便省略它 CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => 0, 但我得到以下错误代码: CURL error: 56 做一些研究,根据Curl()错误列表,这是由于接收网络数据失败造成的 为了克服此错误,我还可以应用哪些其他功能 $curl_options = array(

我通过SOAP向具有自签名证书的Web服务发送一个请求,为此我应用了以下函数以便省略它

        CURLOPT_SSL_VERIFYPEER => false,
        CURLOPT_SSL_VERIFYHOST => 0,
但我得到以下错误代码:

CURL error: 56
做一些研究,根据Curl()错误列表,这是由于接收网络数据失败造成的

为了克服此错误,我还可以应用哪些其他功能

        $curl_options = array(
        CURLOPT_URL => $url,
        CURLOPT_HTTPHEADER => $headers,
        CURLOPT_POST => 1,
        CURLOPT_POSTFIELDS => $data,
        CURLOPT_RETURNTRANSFER => 1,
        CURLOPT_SSL_VERIFYPEER => false,
        CURLOPT_SSL_VERIFYHOST => 0,
        CURLOPT_TIMEOUT =>20

    );

我通过在标题中添加SOAPAction解决了此问题:

$headers = array("Content-type: text/xml;charset=\"utf-8\"", "Accept: text/xml", "SOAPAction: http://direccion.com/Crear", "Content-length: ".strlen($xml), );

我通过在标题中添加SOAPAction解决了此问题:

$headers = array("Content-type: text/xml;charset=\"utf-8\"", "Accept: text/xml", "SOAPAction: http://direccion.com/Crear", "Content-length: ".strlen($xml), );