Does PHP SoapClient support HTTPS connections(PHP SoapClient 是否支持 HTTPS 连接)
问题描述
我在 Windows 上使用 XAMPP 并尝试使用 PHP soap 扩展 SoapClient.我正在尝试使用以下代码加载托管在 HTTPS 站点中的 WSDL 文件
我收到以下错误:
<块引用>致命错误:未捕获的 SoapFault 异常:[WSDL] SOAP 错误:解析 WSDL:无法从
我在使用 php 5.6 的 Windows 上遇到了同样的问题,并且在使用 php 5.6 的 Linux 上运行良好.
您可以使用openssl_get_cert_locations函数来查看证书位置是什么.
到目前为止,我无法找到解决方案.
I'm using XAMPP on Windows and try to work with PHP soap extension SoapClient. I'm trying to load a WSDL file hosted in HTTPS site using the following code
<?php
$myClient=new SoapClient("https://smi.sp.f-secure.com/smi/5.1/services/EchoService?wsdl");
?>
I get the following error:
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://smi.sp.f-secure.com/smi/5.1/services/EchoService?wsdl' : failed to load external entity "https://smi.sp.f-secure.com/smi/5.1/services/EchoService?wsdl" in C:xampphtdocsdevw3schoolssoapClientindex.php:2 Stack trace:
#0 C:xampphtdocsdevw3schoolssoapClientindex.php(2): SoapClient->SoapClient('https://smi.sp....')
#1 {main} thrown in C:xampphtdocsdevw3schoolssoapClientindex.php on line 2
Now I took a network capture during the request and saw that HTTPS communication does not work OK on SSL Level. Wireshark shows a packet on Server Key Exchange my workstation responds with:
TLSv1 Record Layer: Alert (Level: Fatal, Description: Certificate Unknown)
Using nuSOAP client or soapUI utility from the same computer, I'm able to connect to the service normally. So no certificate problems I guess.
So definately it's something with SOAP extension and SSL communication. Can anyone help? Give hints what to look for?
it has to do with this change in php 5.6: http://php.net/manual/en/migration56.openssl.php
I have the same trouble on Windows with php 5.6 and it works fine on Linux with php 5.6.
You can use the function openssl_get_cert_locations to see what are the certificate locations.
So far I wasn't able to find a solution.
这篇关于PHP SoapClient 是否支持 HTTPS 连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PHP SoapClient 是否支持 HTTPS 连接
基础教程推荐
- 超薄框架REST服务两次获得输出 2022-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- 在多维数组中查找最大值 2021-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01