Download the PHP package jalle19/certificate-parser without Composer
On this page you can find all versions of the php package jalle19/certificate-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jalle19/certificate-parser
More information about jalle19/certificate-parser
Files in jalle19/certificate-parser
Package certificate-parser
Short Description A proper SSL/TLS certificate parser library for PHP
License MIT
Homepage https://github.com/Jalle19/certificate-parser
Informations about the package certificate-parser
certificate-parser
A proper SSL/TLS certificate parser library for PHP
Motivation
There are a couple of other existing certificate parsers for PHP out there, but they're all lacking in some way. Some lack configurability (e.g. not being able to change the port to something other than 443), others have mediocre error handling (or none), while some don't allow you to parse certificates that are considered invalid (e.g. an expired or self-signed certificate).
Features
- Completely configurable. This library uses providers to fetch the underlying X.509 certificate before parsing them. This means you can parse e.g. local PEM files too, not just certificates from remote URLs.
- Fault-tolerant. Just because PHP's default settings trigger an error when parsing a certificate doesn't mean you don't want to parse it. This library can handle both self-signed certificates and certificates where the domain name doesn't match.
- Granular error handling. There are multiple exception types for various failure scenarios, so you can choose exactly how you want each type of error to be handled.
Requirements
- PHP >= 7.0 with OpenSSL support
Installation
Usage
You can also find this example in the examples/
directory. If you run it using php examples/example.php
it should
print something like this:
Writing a custom provider
This library ships with two providers:
StreamSocketProvider
- retrieves certificates from a remote server usingstream_socket_client
LocalFileProvider
- retrieves certificates using local files
If these don't suit your needs, create a new provider by implementing the ProviderInterface
interface.
License
MIT
Credits
- https://github.com/acmephp/ssl for the actual parser
- https://github.com/spatie/ssl-certificate and others for inspiration