dongshanyan0322
dongshanyan0322
2015-09-16 21:59
浏览 77
已采纳

无法加载外部实体SOAP SSL

I using PEM certifacte to autheticate WSDL requests.

$cert = '/etc/.../cert.pem';
$client = new SoapClient('https://somesservice.com/service.asmx?WSDL', 
 array( "cache_wsdl" => WSDL_CACHE_NONE,
 "local_cert" => $cert));

I getting failed to load external entity error. If i try get wsdl by curl

 curl --key /etc/.../cert.key --cert /etc/.../cert.pem "https://somesservice.com/service.asmx?WSDL"

it works fine

Edit: Or maybe my PEM certifacte must have a private key section ?

图片转代码服务由CSDN问答提供 功能建议

我使用PEM certifacte来验证WSDL请求。

  $  cert ='/ etc /.../cert.pem'; 
nnclient = new SoapClient('https://somesservice.com/service.asmx?WSDL', 
 array(“cache_wsdl”=> WSDL_CACHE_NONE  ,
“local_cert”=> $ cert)); 
   
 
 

无法加载外部实体错误。 如果我 尝试通过curl获取wsdl

  curl --key /etc/.../cert.key --cert /etc/.../cert.pem“https:/  /somesservice.com/service.asmx?WSDL"
nn

工作正常

编辑: 或许我的PEM证书 必须有一个私钥部分?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • dqf67993
    dqf67993 2015-09-17 14:59
    已采纳

    I had to copy content of KEY file to my PEM file certificate so correct answer is: "YES, PEM file have to contains private key section"

    点赞 评论
  • dongmu1951
    dongmu1951 2015-09-17 09:43

    I think you should send the content of your certificate such as:

    $cert = '/etc/.../cert.pem';
    $client = new SoapClient('https://somesservice.com/service.asmx?WSDL',
        array(
            "cache_wsdl" => WSDL_CACHE_NONE,
            "local_cert" => file_get_contents($cert),
        )
    );
    
    点赞 评论

相关推荐