PHPackages                             jalle19/certificate-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. jalle19/certificate-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

jalle19/certificate-parser
==========================

A proper SSL/TLS certificate parser library for PHP

4.0.0(2mo ago)3678MITPHPPHP &gt;= 8.2CI passing

Since Nov 15Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/Jalle19/certificate-parser)[ Packagist](https://packagist.org/packages/jalle19/certificate-parser)[ Docs](https://github.com/Jalle19/certificate-parser)[ RSS](/packages/jalle19-certificate-parser/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (13)Used By (0)

certificate-parser
==================

[](#certificate-parser)

[![CI](https://github.com/Jalle19/certificate-parser/actions/workflows/ci.yml/badge.svg)](https://github.com/Jalle19/certificate-parser/actions/workflows/ci.yml)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/ad003862cccf65f8476dd38fb10f31c99c80a1176a849e3bfd980031e015b953/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4a616c6c6531392f63657274696669636174652d7061727365722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Jalle19/certificate-parser/?branch=master)[![Coverage Status](https://camo.githubusercontent.com/d0135c2e248758d136fe613465cddde2885683347f39d18533868482cf83ca9a/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4a616c6c6531392f63657274696669636174652d7061727365722f62616467652e737667)](https://coveralls.io/github/Jalle19/certificate-parser)

A proper SSL/TLS certificate parser library for PHP

Motivation
----------

[](#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
--------

[](#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
------------

[](#requirements)

- PHP &gt;= 8.2 with OpenSSL support

Installation
------------

[](#installation)

```
composer require jalle19/certificate-parser

```

Usage
-----

[](#usage)

```
