簡體   English   中英

SOAP:無效的HTTPS客戶端證書路徑

[英]SOAP: Invalid HTTPS client certificate path

當我運行下面給出的代碼時,錯誤ERROR: Invalid HTTPS client certificate path生成。 我檢查了certificate.pem和test.wsdl的路徑是否正確。 這種錯誤的原因可能是什么?

$wsdl = 'http://localhost:10088/test/test.wsdl';

$options = array(
    'local_cert' => 'http://localhost:10088/test/certificate.pem',
    'soap_version' => SOAP_1_1
);


try {
    $client = new Zend_Soap_Client($wsdl, $options);
    $result = $client->getLastResponse();
    print_r($result);
} catch (SoapFault $s) {
    die('ERROR: [' . $s->faultcode . '] ' . $s->faultstring);
} catch (Exception $e) {
    die('ERROR: ' . $e->getMessage());
}

該選項的值local_cert必須是文件路徑,而不是一個URL。 將代碼更改為$options

$options = array(
    'local_cert' => '/path_where_cert_is_stored/certificate.pem',
    'soap_version' => SOAP_1_1
);

由於Zend_Soap_Client的文檔還不完善,因此您可以查看PHP: Zend_Soap_Client 手冊以獲取更多信息,因為Zend_Soap_Client可以在Zend_Soap_Client使用它。 在我看來,可能的參數在PHP:SoapClient :: SoapClient-手冊 (尤其是示例)中有更好的描述。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM