简体   繁体   中英

PHP Soap Client cannot load https wsdl link

I have been trying to load a particular https wsdl via php soapclient. The error that I am getting is:

SOAP-ERROR: Parsing WSDL: Couldn't load from ' https://xxxx.com?wsdl ': failed to load external entity " https://xxxx.com?wsdl " Moreover I also try to "Curl https://xxxx.com?wsdl " as well. The error that I am getting is:

curl: (35) error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small

I am able to view the particular wsdl via browser. Curl with http instead of https returns the correct response.

The weird thing is that, my colleague has ubuntu 18.04 installed on his machine and he does not have any problems. For your information, I have debian 10 installed and we both have the same IP address.

I really don't understand where the issue can be.

You should try disable certificate validation when construct SoapClient instance

$context = stream_context_create([
    'ssl' => [
        // set some SSL/TLS specific options
        'verify_peer' => false,
        'verify_peer_name' => false,
        'allow_self_signed' => true
    ]
]);

$client  = new SoapClient($url, [
    ... ( other params )
    'stream_context' => $context
]);

If you use curl from command line you can use the --insecure/-k flag.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM