简体   繁体   English

PHP Soap 客户端无法加载 https wsdl 链接

[英]PHP Soap Client cannot load https wsdl link

I have been trying to load a particular https wsdl via php soapclient.我一直在尝试通过 php soapclient 加载特定的 https wsdl。 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. 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 ”也是如此。 The error that I am getting is:我得到的错误是:

curl: (35) error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small curl: (35) 错误:141A318A:SSL 例程:tls_process_ske_dhe:dh 键太小

I am able to view the particular wsdl via browser.我可以通过浏览器查看特定的 wsdl。 Curl with http instead of https returns the correct response. Curl 与 http 而不是 https 返回正确的响应。

The weird thing is that, my colleague has ubuntu 18.04 installed on his machine and he does not have any problems.奇怪的是,我的同事在他的机器上安装了 ubuntu 18.04,他没有任何问题。 For your information, I have debian 10 installed and we both have the same IP address.供您参考,我安装了 debian 10 并且我们都有相同的 IP 地址。

I really don't understand where the issue can be.我真的不明白问题出在哪里。

You should try disable certificate validation when construct SoapClient instance您应该在构造 SoapClient 实例时尝试禁用证书验证

$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.如果您从命令行使用 curl,您可以使用 --insecure/-k 标志。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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