RSS

Mutual Authentication

Buka httpd-vhost.conf

<VirtualHost *:443>
ServerName mywebs.com
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
CustomLog C:/www/apache/logs/access.log vcommon
 
DocumentRoot C:/www/htdocs/mywebs.com
SSLEngine On
SSLCertificateFile C:/www/apache/conf/ssl.crt/webserver.crt
SSLCertificateKeyFile C:/www/apache/conf/ssl.key/webserver.key
SSLCACertificateFile C:/www/apache/conf/ssl.crt/cacert.pem

SSLVerifyClient require
SSLVerifyDepth 1
SSLOptions +StdEnvVars +ExportCertData
</VirtualHost>

index.php


<?php
  echo "<h1>INFORMASI SERTIFIKAT CLIENT</h1><hr>";
    if(array_key_exists('SSL_CLIENT_CERT', $_SERVER)){
        echo "<b>Bentuk Asli X509:</b><br>" ;
    print_r($_SERVER['SSL_CLIENT_CERT']);
    echo "<hr>";
    echo "<b>Hasil Parsing :</b><br><pre>";
    $client_cert_data = openssl_x509_parse($_SERVER['SSL_CLIENT_CERT']);
        print_r($client_cert_data);
        echo "</pre>";
    }
 


0 komentar:

Posting Komentar