- CRL (Certificate Revocation List) validation
- Expiration validation
- Signed by a Trusted CA validation (with self-signed support)
- PHP >=7.2
- Laravel >=6
composer require pverdu/x509-certificate-validator`
The service provider should be autodiscovered, if not you can add it to your container using:
// ...
PVerdu\x509CertificateValidator\x509CertificateValidatorServiceProvider::class
// ...
Make sure your webserver sends the client certificate to your application either via the headers or the global $_SERVER
variable.
Add the PVerdu\x509CertificateValidator\Middleware\CertificateValidatorMiddleware
to any routes you want the certificate to be validated on per request.
If you want to change the configuration, for example to change the trusted certificate store paths, you must publish the configuration using the command below:
php artisan vendor:publish --provider=PVerdu\\x509CertificateValidator\\x509CertificateValidatorServiceProvider