简体   繁体   中英

How to validate certificate in soap service in php?

We are sending certificate to soap service using following code

$wsdl = "https://localhost/MyService/myservices.php?wsdl";
$local_cert = "C:\\SoapCerts\ClientKeyAndCer.pem";
$soapClient = new SoapClient($wsdl, array('local_cert' => $local_cert));
$theResponse = $soapClient->test();

But there is no reference to validate that certificate in service. I just want to know how to validate the correct certificate in service code.

Try to put both private key and public key at the same PEM file. Something like this in linux:

# cat publicKey.pem privateKey.pem > key.pem

So, check if the path to your PEM file is correct (escaping slashes):

$local_cert = "C:\\SoapCerts\\ClientKeyAndCer.pem";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM