Answer the question
In order to leave comments, you need to log in
How to connect to Soap server with personal certificate?
There is a Soap server, a pfx file with a personal certificate is provided, when installing the certificate in the browser, the wsdl page opens correctly, when trying to create a connection, getting an exception:
SOAP-ERROR: Parsing WSDL: Couldn't load from: failed to load external entity
What I tried :
Unpacked the pfx file with the openssl_pkcs12_read function, received a certificate and a
private key for signing the request.
I wrote them into a pem file, and I specify it in the client parameters:
new \SoapClient($wsdl, ['local_cert' => 'path\sign.pem'])
Answer the question
In order to leave comments, you need to log in
If the wsdl is located on the same host as the soap server (with certificate verification), then the client will not be able to read the wsdl even if the certificate is passed to local_cert, so the wsdl must be downloaded and specified in the constructor, like this:
$wsdl = 'C:\wsdl.xml';
new \SoapClient($wsdl, ['local_cert' => 'path\sign.pem']);
google the error instead of inventing unnecessary gestures
https://stackoverflow.com/questions/12875409/soap-...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question