SoapFault exception: Could not connect to host

后端 未结 27 1638
-上瘾入骨i
-上瘾入骨i 2020-12-01 07:47

Sometimes fail to call the web service.

This problem happens all the time.

What could be the problem?

Error:
    SoapFault exception: [HTTP]          


        
27条回答
  •  旧时难觅i
    2020-12-01 08:35

    I finally found the reason,its becuse of the library can't find a CA bundle on your system. PHP >= v5.6 automatically sets verify_peer to true by default. However, not all systems have a known CA bundle on disk .

    You can try one of these procedures:

    1.If you have a CA file on your system, set openssl.cafile or curl.cainfo in your php.ini to the path of your CA file.

    2.Manually specify your SSL CA file location

    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);  
    curl_setopt($cHandler, CURLOPT_CAINFO, $path-of-your-ca-file);
    

    3.disabled verify_peer

    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    

提交回复
热议问题