SoapClient and apache strong authentication with openssl certificate
| From: | Denis Fingonnet | Date: | Mon, 04 Apr 2011 12:58:30 +0000 |
| Subject: | SoapClient and apache strong authentication with openssl certificate | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-312238@lists.php.net to get a copy of this message | ||
Hello all,
I have a question for you.
I succeeded on generating certificates, securing apache and connecting to a
web service using soap with a certificate authentication mecanism.
Now, i'm wondering what the openssl module can do.
My wish is to generate a client certificate through the openssl module's
functions.
But the documentation isn't very useful at the moment.
I'm trying to do the exact same thing as :
https://gist.github.com/901407starting at the
line 8
It looks like :
$privkey = openssl_pkey_new();
$privkey = openssl_pkey_new();
$csr = openssl_csr_new($dn, $privkey);
$sscert = openssl_csr_sign($csr, file_get_contents('/PATH_TO/ca.crt'),
file_get_contents('/PATH_TO/ca.key'), 10000);
openssl_x509_export($sscert, $cert);
openssl_pkcs12_export($cert, $pkcs12, $privkey, '', array('clcerts',
'nokeys'));
And here I'm stuck. Is there a way to do the following command in PHP ?
openssl pkcs12 -nodes -clcerts -in cacert.p12 -out client.pem
thanks
Denis Fingonnet