1. Go to this page and download the library: Download zim32/cert-auth-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zim32 / cert-auth-bundle example snippets
# app/AppKernel.php
$bundles = array(
...
new Zim\CertAuthBundle\ZimCertAuthBundle(),
...
);
namespace AppBundle\EventListener;
use Symfony\Component\HttpFoundation\RequestStack;
use Zim\CertAuthBundle\Event\ModifyClientCSREvent;
class ModifyCSREventListener
{
protected $requestStack;
public function __construct(RequestStack $requestStack)
{
$this->requestStack = $requestStack;
}
public function handle(ModifyClientCSREvent $event)
{
$event->dn['ipAddress'] = $this->requestStack->getCurrentRequest()->getClientIp();
}
}