SoapClient does not send certificate

I read all the questions / answers I could find, but no one solved my problem.

here connecting to the same URL using cURL and certificate ($ pem = absolute path to the .pem file) this works

    $ch = curl_init($wsdl); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
    curl_setopt($ch, CURLOPT_SSLCERT, $pem);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    $response = curl_exec($ch);

The end here is the code that I tried to connect to wsdl via SOAP

$client  = new SoapClient($wsdl, array('local_cert' => $pem));

Even tried loading the contents of the certificate into 'local_cert'

$client  = new SoapClient($wsdl, array('local_cert' => file_get_contents($pem)));

In both lines of soap code, I get an error message from the server, saying that I was not authorized ...

Do I need to activate something before sending the certificate?

+3
source share
1 answer

There may be some username and password that you must pass, try the following:

curlku user:passwordd @myRequestFile.xml uri
+1
source

All Articles