f00b4r / nusoap

:smirk: Fixed NuSOAP for PHP 5.6 - 8.2
https://f00b4r.github.io/nusoap/
318 stars 355 forks source link

Use passphrase and local keystore when initialising #36

Open cargellio opened 6 years ago

cargellio commented 6 years ago

In PHP's in built soapclient I can add a local_cert, and passphrase as options. This feature is not possible at all in nusoap as far as I could determine. Will that be available in future releases. Unfortunately I had to fall back on php soapclient again

Example
$local_cert = '/directory/path/to/password.pfx';
$passphrase = 'password';
$options = [
    'keep_alive'    => true,
    'trace'         => false,
    'local_cert'    => $local_cert,
    'passphrase'    => $passphrase,
    'cache_wsdl'    => WSDL_CACHE_NONE,
];
$soapcli = new SoapClient($WSDL, $options);
carlosanpardo commented 4 years ago

Hello! Try with:

$certRequest = array('', 'sslcertfile' => FCPATH."uploads/cert.crt", 'sslkeyfile' => FCPATH."uploads/cert_key.key", 'passphrase' => '', 'verifypeer' => 0, 'verifyhost' => 0);
$client->setCredentials('', '', 'certificate', $certRequest);