PHPackages                             spatie/ssl-certificate-chain-resolver - 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. [Security](/categories/security)
4. /
5. spatie/ssl-certificate-chain-resolver

ActiveLibrary[Security](/categories/security)

spatie/ssl-certificate-chain-resolver
=====================================

SSL certificate chain resolver

3.0.2(5mo ago)3069.6k↓37.5%40MITPHPPHP ^8.0

Since Jan 29Pushed 5mo ago8 watchersCompare

[ Source](https://github.com/spatie/ssl-certificate-chain-resolver)[ Packagist](https://packagist.org/packages/spatie/ssl-certificate-chain-resolver)[ Docs](https://github.com/spatie/ssl-certificate-chain-resolver)[ RSS](/packages/spatie-ssl-certificate-chain-resolver/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (17)Used By (0)

SSL Certificate Chain Resolver
==============================

[](#ssl-certificate-chain-resolver)

[![Latest Version](https://camo.githubusercontent.com/4b6d8a1a0c4af568546cb09912869c391c3f48ce2d700962917c783bdf2da47f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f7370617469652f73736c2d63657274696669636174652d636861696e2d7265736f6c7665722e7376673f7374796c653d666c61742d737175617265)](https://github.com/spatie/ssl-certificate-chain-resolver/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/34dd097b95545900f633ed61529aa7f1a87517d9cb094de56e8434424e8a1138/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7370617469652f73736c2d63657274696669636174652d636861696e2d7265736f6c7665722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/spatie/ssl-certificate-chain-resolver)[![Quality Score](https://camo.githubusercontent.com/61c2388133395e86fc1f3c6acaaf3c536f7717718ff98bf5d9d624998efe2448/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7370617469652f73736c2d63657274696669636174652d636861696e2d7265736f6c7665722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/spatie/ssl-certificate-chain-resolver)[![StyleCI](https://camo.githubusercontent.com/f394268d109fa7818e531fedec720cf722b8593b196b23beb5e0604ea93ebace/68747470733a2f2f7374796c6563692e696f2f7265706f732f32393933393938362f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/29939986)[![Total Downloads](https://camo.githubusercontent.com/aa4266e9f6892f0f5bffe6349d54d4ca79dc0014df9884de26ac2ed42a5f81b0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f73736c2d63657274696669636174652d636861696e2d7265736f6c7665722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/ssl-certificate-chain-resolver)

All operating systems contain a set of default trusted root certificates. But Certificate Authorities usually don't use their root certificate to sign customer certificates. They use so called intermediate certificates instead, because these can be rotated more frequently.

If not all intermediate certificates are installed on your server, some clients —mostly mobile browsers— will think you are on an insecure connection.

This tool can help you fix the [incomplete certificate chain issue](#background-the-trust-chain), also reported as *Extra download* by [Qualys SSL Server Test](https://www.ssllabs.com/ssltest/).

Spatie is a webdesign agency in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource).

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/60460361849ba815ff0e68b71c291120d9bf88536a98886dfc8fa89bdbdd9ca0/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f73736c2d63657274696669636174652d636861696e2d7265736f6c7665722e6a70673f743d31)](https://spatie.be/github-ad-click/ssl-certificate-chain-resolver)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

Postcardware
------------

[](#postcardware)

You're free to use this package (it's [MIT-licensed](LICENSE.md)), but if it makes it to your production environment you are required to send us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium.

The best postcards will get published on the open source page on our website.

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

[](#installation)

This package can be installed using composer by running this command.

```
composer global require spatie/ssl-certificate-chain-resolver
```

Usage
-----

[](#usage)

Let's assume you have an incomplete certificate called `cert.crt`. To generate the a file containing the certificate and the entire trust chain, you can use this command:

```
ssl-certificate-chain-resolver resolve cert.crt
```

A file containing the certificate and the entire trust chain will be saved as `certificate-including-trust-chain.crt`

You can also pass the name of the file of the outputfile as the second argument:

```
ssl-certificate-chain-resolver resolve cert.crt your-output-file.crt
```

If the outputfile already exists, you will be asked if it's ok to overwrite it.

Updating
--------

[](#updating)

You can update **ssl-certificate-chain-resolver** to the latest version by running:

```
composer global update spatie/ssl-certificate-chain-resolver
```

Limitations
-----------

[](#limitations)

Currently this package does not work with Entity validation certificates or certificates issued by Let's Encrypt. A PR that adds this to package would be highly appreciated.

Testing
-------

[](#testing)

Functional and unit tests are included with the package.

You can run them yourself with `vendor/bin/codecept run`

Credits
-------

[](#credits)

- [Freek Van der Herten](https:/murze.be)
- [All Contributors](https://github.com/freekmurze/ssl-certificate-chain-resolver/contributors)

This package was inspired by [cert-chain-resolver](https://github.com/zakjan/cert-chain-resolver/) written by [Jan Žák](http://www.zakjan.cz/). Some text, mainly the background about the trust chain, was copied from the readme of his repo.

Background: the trust chain
---------------------------

[](#background-the-trust-chain)

All operating systems contain a set of default trusted root certificates. But Certificate Authorities usually don't use their root certificate to sign customer certificates. Instead of they use so called intermediate certificates, because they can be rotated more frequently.

A certificate can contain a special Authority Information Access extension (RFC-3280) with URL to issuer's certificate. Most browsers can use the AIA extension to download missing intermediate certificate to complete the certificate chain. This is the exact meaning of the Extra download message. But some clients, mostly mobile browsers, don't support this extension, so they report such certificate as untrusted.

This results in 'untrusted'-warnings like this, since the browser thinks you are on an insecure connection.

[![Untrusted Warning](images/untrusted.png)](images/untrusted.png)

A server should always send a complete chain, which means concatenated all certificates from the certificate to the trusted root certificate (exclusive, in this order), to prevent such issues. So when installing a SSL certificate on a server you should install all intermediate certificates as well. You should be able to fetch intermediate certificates from the issuer and concat them together by yourself.

This tool helps you automatize that boring task by looping over certificate's AIA extension field.

About Spatie
------------

[](#about-spatie)

Spatie is a webdesign agency in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance70

Regular maintenance activity

Popularity45

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 76.1% 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 ~282 days

Recently: every ~652 days

Total

15

Last Release

175d ago

Major Versions

0.1.4 → 1.0.02015-01-29

1.0.6 → 2.0.02016-12-25

2.0.3 → 3.0.02022-06-13

PHP version history (2 changes)2.0.0PHP ^7.0

3.0.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (83 commits)")[![MatthiasDeWinter](https://avatars.githubusercontent.com/u/8791525?v=4)](https://github.com/MatthiasDeWinter "MatthiasDeWinter (8 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (5 commits)")[![thecaliskan](https://avatars.githubusercontent.com/u/13554944?v=4)](https://github.com/thecaliskan "thecaliskan (2 commits)")[![syphernl](https://avatars.githubusercontent.com/u/639906?v=4)](https://github.com/syphernl "syphernl (2 commits)")[![angeljqv](https://avatars.githubusercontent.com/u/79208641?v=4)](https://github.com/angeljqv "angeljqv (1 commits)")[![henrikalves](https://avatars.githubusercontent.com/u/89079890?v=4)](https://github.com/henrikalves "henrikalves (1 commits)")[![Manawyrm](https://avatars.githubusercontent.com/u/748791?v=4)](https://github.com/Manawyrm "Manawyrm (1 commits)")[![amaelftah](https://avatars.githubusercontent.com/u/17250137?v=4)](https://github.com/amaelftah "amaelftah (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")[![SamuelNitsche](https://avatars.githubusercontent.com/u/24483576?v=4)](https://github.com/SamuelNitsche "SamuelNitsche (1 commits)")[![stayallive](https://avatars.githubusercontent.com/u/1090754?v=4)](https://github.com/stayallive "stayallive (1 commits)")[![akoepcke](https://avatars.githubusercontent.com/u/5311185?v=4)](https://github.com/akoepcke "akoepcke (1 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (1 commits)")

---

Tags

certificatecertificate-authorityphpsecurityssltrust-chainhttpscertificatesslChainssl-certificate-chain-resolver

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/spatie-ssl-certificate-chain-resolver/health.svg)

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

###  Alternatives

[acmephp/core

Raw implementation of the ACME protocol in PHP

38973.7k7](/packages/acmephp-core)[kelunik/acme

ACME library written in PHP.

121603.9k3](/packages/kelunik-acme)[acmephp/acmephp

Let's Encrypt client written in PHP

649155.1k](/packages/acmephp-acmephp)[kelunik/acme-client

Let's Encrypt / ACME client written in PHP for the CLI.

3933.9k1](/packages/kelunik-acme-client)[daanra/laravel-lets-encrypt

A Laravel package to easily generate SSL certificates using Let's Encrypt

22650.9k](/packages/daanra-laravel-lets-encrypt)[acmephp/ssl

PHP wrapper around OpenSSL extension providing SSL encoding, decoding, parsing and signing features

141.2M4](/packages/acmephp-ssl)

PHPackages © 2026

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