|
Posted by Peter Brodersen on 10/21/00 11:17
On Thu, 26 May 2005 21:32:27 +0200, in php.general php@ter.dk (Peter
Brodersen) wrote:
>A phpinfo() only shows that $_SERVER['HTTPS'] has been set to "on".
>The mod_ssl-refrence shows though that a lot of other environment
>variables should be present:
>http://www.modssl.org/docs/2.1/ssl_reference.html#ToC23
>.. but I can't seem to retrieve this information anywhere.
I reached the following solution:
I never got access to any SSL_*-variables under $_SERVER (not even the
server variables or using another language - or server, php version
and OS), but a workaround for Apache and mod_ssl is to add
SSLOptions +ExportCertData
to httpd.conf (or .htaccess)
The certificate presented by the client would then be stored in
$_SERVER['SSL_CLIENT_CERT'] (the only SSL_*-variable available,
besides SSL_SERVER_CERT). The data could then be retrieved using
openssl_x509_parse(), e.g.:
<?php
$cert = openssl_x509_parse($_SERVER['SSL_CLIENT_CERT']);
print $cert['subject']['CN'];
?>
I would still like to know why the SSL-variables aren't available, but
I don't think this is a PHP issue.
Just wanted to post my solution for the sake of mail archives :-)
--
- Peter Brodersen
Navigation:
[Reply to this message]
|