[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: woody with apache-php: x509 doesn't work



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 27 April 2004 17:45, Fabio Massimo Di Nitto wrote:
 >On Tue, 27 Apr 2004, Maurizio Marini wrote:
 >> On Tuesday 27 April 2004 17:16, Fabio Massimo Di Nitto wrote:
 >>  >Hi Maurizio,
 >>  >
 >>  >On Tue, 27 Apr 2004, Maurizio Marini wrote:
 >>  >> Hi there,
 >>  >> i've a woody box with apache+php; trying to show a client cert i get:
 >>  >> Fatal error: Call to undefined function: openssl_x509_read()
 >
 >How are you performing this operation? I can't find any reference to
 >x509_read anywhere.
 >
 >Fabio
i'm testing client certs,
in httpd.conf i've:

<VirtualHost *:443>
[..]
                SSLVerifyClient none
                <Location /test_client_cert>
                        SSLRequireSSL
                        SSLVerifyClient require
                        SSLVerifyDepth 10
                </Location>
                SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
        </IfModule>
</VirtualHost>

in dir test_client_cert i've a small piece of php that show client cert, taken from php.net examples:
 cat show_cert.php
<?php
    $beginpem = "-----BEGIN CERTIFICATE-----\n";
    $endpem = "-----END CERTIFICATE-----\n";

   // Small function to print the data recursivly.
    function print_element($item, $key)
    {
        if( is_array( $item ) )
        {
            echo "<br>$key is Array:<br>";
            array_walk( $item, 'print_element' );
            echo "$key done<br><br>";
        }
        else
            echo "$key = $item<br>";
    }

   // Build the PEM string.
   // $pemdata = $beginpem.$_SERVER["CLIENT_CERT"]."\n".$endpem;

        $pemdata = $_SERVER["SSL_CLIENT_CERT"];
        echo '-- show client cert content --<br>';
   // Get a certificate resource from the PEM string.
    $cert = openssl_x509_read( $pemdata );

   // Parse the resource and print out the contents.
    $cert_data = openssl_x509_parse( $cert );
        echo 'username autenticato: '.$_SERVER['REMOTE_USER'];
    array_walk( $cert_data, 'print_element' );

   // Free the resource
    openssl_x509_free( $cert );
 ?>


when i try to authenticate myself in a redhat 7.3 box, this php does show cert content, 
the same doesn't work in a woody box; i suppose php4 woody installation lacks 
x509 support, doesn't it?
	m.


- -- 
Maurizio Marini		GSM +39-335-8259739
Work: +39-0721-855285	Fax +39-0721-859609
Home: +39-721-950396
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQFAj2424Q/49nIJTlwRAo9ZAJ0V1jo4docO6kEzSJp2Faq/2c50vACfUkZe
1XedFAhkFxi5kWiuIAFswHk=
=oeI9
-----END PGP SIGNATURE-----



Reply to: