PHPackages                             joelwmale/php-ssl-certificate - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. joelwmale/php-ssl-certificate

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

joelwmale/php-ssl-certificate
=============================

Easily retrieve the ssl certificate for any host

4.0.0(3mo ago)63.4k↓50%1MITPHPPHP ^8.3CI passing

Since Jul 30Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/joelwmale/php-ssl-certificate)[ Packagist](https://packagist.org/packages/joelwmale/php-ssl-certificate)[ Docs](https://github.com/joelwmale/php-ssl-certificate)[ RSS](/packages/joelwmale-php-ssl-certificate/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (3)Versions (12)Used By (0)

Easily retrieve the ssl certificate for any host
================================================

[](#easily-retrieve-the-ssl-certificate-for-any-host)

[![Build Status](https://github.com/joelwmale/php-ssl-certificate/actions/workflows/tests.yml/badge.svg)](https://github.com/joelwmale/php-ssl-certificate/actions/workflows/tests.yml)[![Total Downloads](https://camo.githubusercontent.com/5766bc0669a9c303046953f70fb8e38447f9b1633259bfb6bbe71da4fe768321/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f656c776d616c652f7068702d73736c2d6365727469666963617465)](https://packagist.org/packages/joelwmale/php-ssl-certificate)[![Latest Stable Version](https://camo.githubusercontent.com/c414612bef68e36ca923f6babd716e5fb93be79a16c7b0a6e4f30aa66a358207/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f656c776d616c652f7068702d73736c2d6365727469666963617465)](https://packagist.org/packages/joelwmale/php-ssl-certificate)[![License](https://camo.githubusercontent.com/08ecb6f9ee22c4e9fcbe38f779b4cac452a68c89f85b36e8483928d99a4c23f6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a6f656c776d616c652f7068702d73736c2d6365727469666963617465)](https://packagist.org/packages/joelwmale/php-ssl-certificate)

This package makes it easy to download a certificate for a host.

Version Compatibility
---------------------

[](#version-compatibility)

PHP VersionPackage Version8.3+4.x8.0 - 8.23.xUsage
-----

[](#usage)

```
use Joelwmale\SslCertificate\Certificate;

$certificate = Certificate::forHost('joelmale.com');
```

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

[](#installation)

You can install the package via composer:

```
composer require joelwmale/php-ssl-certificate
```

Available Properties &amp; Methods
----------------------------------

[](#available-properties--methods)

All properties are `readonly`.

```
$certificate->issuer;              // string - the issuer of the certificate
$certificate->domain;              // string - the primary domain on the certificate
$certificate->additionalDomains;   // array  - all the additional/alt domains on the certificate
$certificate->valid;               // bool   - true if valid, false if not
$certificate->issued;              // Carbon - when the certificate was issued
$certificate->expires;             // Carbon - when the certificate expires
$certificate->expiresIn;           // int    - days until the certificate expires
$certificate->expired;             // bool   - true if the certificate is expired
$certificate->signatureAlgorithm;  // string - the signature algorithm used to sign the certificate
$certificate->isSelfSigned;        // bool   - true if the certificate was self signed
```

### Get raw certificate as JSON

[](#get-raw-certificate-as-json)

```
$certificate->getRawCertificateFieldsAsJson();
```

### Determining if the certificate is valid at a given date

[](#determining-if-the-certificate-is-valid-at-a-given-date)

Returns true if the certificate will still be valid. Takes a Carbon instance as the first parameter.

```
$certificate->isValidAt(Carbon::today()->addMonth(1));
```

### Determining if certificate contains/covers a domain

[](#determining-if-certificate-containscovers-a-domain)

Returns true if the certificate contains the domain

```
$certificate->containsDomain('joelmale.dev');
```

Testing
-------

[](#testing)

```
$ composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for a list of recent changes.

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance82

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 84.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~398 days

Recently: every ~404 days

Total

7

Last Release

95d ago

Major Versions

1.0.1 → 2.0.22021-09-11

2.0.3 → 3.0.02025-12-23

3.0.1 → 4.0.02026-02-13

PHP version history (5 changes)1.0.0PHP ^7.2

2.0.2PHP ^7.2|^8.0

2.0.3PHP ^7.2|^8.0|^8.1|^8.2|^8.3|^8.4|^8.5

3.0.0PHP ^8

4.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/9bee9935aeef3432dfbdbc6356ac4a5426aa6b22d67d15747bfb341c6ad62689?d=identicon)[joelwmale](/maintainers/joelwmale)

---

Top Contributors

[![joelwmale](https://avatars.githubusercontent.com/u/3906839?v=4)](https://github.com/joelwmale "joelwmale (28 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (5 commits)")

---

Tags

laravelphpssl-certificatephpcertificatessljoelwmale

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/joelwmale-php-ssl-certificate/health.svg)

```
[![Health](https://phpackages.com/badges/joelwmale-php-ssl-certificate/health.svg)](https://phpackages.com/packages/joelwmale-php-ssl-certificate)
```

###  Alternatives

[composer/ca-bundle

Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.

3.0k346.2M191](/packages/composer-ca-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
