【发布时间】:2014-11-21 13:34:10
【问题描述】:
我正在尝试使用以下代码设置 Soap 客户端:
<?php
$wsdl = 'https://domain.com/?wsdl';
$endpoint = 'https://domain.com';
$certificate = dirname(__FILE__) . '/CertWithKey.pem';
$password = 'pwd';
$options = array(
'location' => $endpoint,
'keep_alive' => true,
'trace' => true,
'local_cert' => $certificate,
'passphrase' => $password,
'cache_wsdl' => WSDL_CACHE_NONE
);
try {
$soapClient = new SoapClient($wsdl, $options);
} catch(Exception $e) {
var_dump($e);
}
我获得了一个带有 .crt 认证文件的 .p12 密钥文件。使用 openssl 我已将 .p12 文件转换为 .pem 文件,然后将其与 .crt 文件合并。 CertWithKey.pem 对我来说看起来不错,文件中有两个证书块。
无论我尝试做什么,我都会收到消息SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://domain.com/?wsdl' : failed to load external entity "https://domain.com/?wsdl" 的异常。
在与远程方通话后,他们确认收到了请求,但他们记录了此错误:ssl handshake interrupted by system [hint: stop button pressed in browser?!]。
由于到目前为止我在网上没有找到任何有用的信息,所以我想请大家对此事有所了解。
有什么可以尝试的建议吗?我正在运行 PHP 5.3.8,服务器的 IP 地址在远程方的防火墙中被列入白名单。
【问题讨论】:
标签: php ssl soap wsdl ssl-certificate