當使用PHP做一個SOAP請求到HTTPS SOAP服務器:■SoapClient的失敗,一個的SOAPFault:PHP的SoapClient的verify_peer =>真正的失敗,CA簽發的證書
faultstring: Could not connect to host faultcode: HTTP
我必須肯定的是,肥皂服務器ssl證書是有效的,所以我使用
<?php
$soap=new SoapClient("mwsdl.wsdl"
,array(
"location"=>"https:examplesoapserver.com"
,"trace"=>1
,"stream_context"=>stream_context_create(array(
"ssl"=>array(
"verify_peer"=>true
,"allow_self_signed"=>false
)
)
)
)
);
但是,這給了我SoapFault。
我有不同的設置進行了測試:
OK location: has self-signed certificate verify_peer=>true allow_self_signed=>true
OK (without setting verify_peer) location: has self-signed certificate allow_self_signed=>false
NOT OK location: has self-signed certificate verify_peer=>true allow_self_signed=>false
OK (without setting verify_peer) location: ca-signed certificate allow_self_signed=>false
NOT OK location: ca-signed certificate verify_peer=>true allow_self_signed=>false
我:
php version: 5.3.3 CentOS 6.4 Apache/2.2.15
要求提供更多的細節,如果有幫助圖解決問題。
非常感謝您的幫助!