Page 1 of 1

Convert .certificate ".cer to .pem"

Posted: Thu Apr 09, 2009 9:44 am
by thegunner
Hi I'm trying to connect to a web service which require a certificate.

I can connect but I'm getting the error:

Fault
Array
(
[faultcode] => soap:Server
[faultstring] => No trusted certificate was provided
[detail] =>
)

I have the certificate installed on my machine an can connect via browser.

Now I need to pass it in with PHP but from what I can gather opnline it needs to be in .pem format? Correct?


At the moment my php is:

<?php

require_once('../lib/nusoap.php');

$client = new soapclient('https://myserver.com/suppliers/document ... sdl',array('local_cert' => "thawte.cer"));

$err = $client->getError();

if ($err) { echo '<h2>Constructor error</h2><pre>' . $err . '</pre>'; }

$result = $client->call('DownloadList', array(), '', '', false, true);

if ($client->fault) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
$err = $client->getError();
if ($err) {
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
echo '<h2>Result</h2><pre>';
print_r($result);
echo '</pre>';
}
}

echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';

?>


Does anyone know I can convert the .cer to .pem ?

Thanks,

Garry