victord11/ssl-certification-health-check
Monitor SSL certificate health in Laravel: check expiry dates, validity, issuer, and chain issues before they break your site. Run automated checks and get alerted when certificates are nearing expiration or misconfigured.
Architecture fit. This is a single-purpose, leaf-level package: it registers an SSL-certificate check with a Laravel health-check runner and returns pass/fail for a configured set of hosts. It introduces no persistence, no queue topology, no service boundary, and no architectural coupling beyond whatever health-check framework it extends (most likely spatie/laravel-health, which is the de facto standard in the Laravel ecosystem — this must be confirmed against the package's composer.json). Because of that, it fits any Laravel application that already exposes a health endpoint or runs scheduled diagnostics, and it is equally easy to remove. It does not fit non-Laravel PHP services, and it is a monitoring probe, not a certificate-management tool — it will not renew, rotate, or deploy certificates.
Integration feasibility. Technically straightforward: expect a service provider, a publishable config file listing target domains, and a Check class. A competent Laravel developer should have it running in a throwaway environment inside a day, most of which is spent confirming dependency constraints rather than writing code. The real feasibility question is not "can we integrate this" but "should we depend on it": 17 stars and a last release of 2024-03-28 is a weak maintenance signal, and a single-purpose package that small is also a package that is cheap to replicate. MIT licensing means fork-and-vendor is a legitimate fallback, so the integration risk is bounded even if upstream goes quiet.
Technical risk. Blast radius is low — the check reads configuration, performs an outbound TLS handshake, and returns an enumerated result. The risks are concentrated in hygiene and coverage rather than correctness:
Key questions. (1) Which health-check framework does it extend, and at what version constraint? (2) What are the supported PHP and Laravel version ranges, and is auto-discovery enabled? (3) Does it validate the full chain and hostname match, or expiry alone? (4) Does it support custom ports, SNI overrides, and configurable timeouts? (5) How does it behave on DNS failure, connection refusal, and timeout — distinct result or generic "unhealthy"? (6) Is there a test suite, and does CI run against multiple Laravel versions? (7) Does it cache results, and can it be scheduled independently of the HTTP endpoint? (8) Is there any mechanism to assert a minimum remaining validity window (e.g. fail at 21 days), or is it binary?
Stack fit. Assumes a Laravel 10/11 application on PHP 8.1+ with either the framework health route or spatie/laravel-health already present. If the team already runs a structured health-check registry, this slots in as one more check with essentially zero design work. If there is no health-check framework in place, adopting one package to get another is the wrong order of operations — evaluate spatie/laravel-health first on its own merits.
Migration path. None required; the change is additive and reversible via config. But make the build-vs-buy call explicitly rather than by default, because the effort is genuinely comparable:
openssl_x509_parse over a stream context, asserting validTo against a threshold and comparing SANs to the hostname, is on the order of 40 lines and eliminates the dependency entirely.Compatibility and sequencing. Verify in this order: composer why and constraint inspection against our current framework version → confirm service-provider auto-discovery and config-publish behaviour → run the check against a deliberately curated fixture set (one soon-to-expire cert, one self-signed, one with a missing intermediate, one wildcard, one behind a CDN, one unreachable host) and record actual outputs. Only after that behaviour is characterised should it be wired into anything that pages a human.
Rollout: feature-flag the check into non-production first with output-only logging, run it alongside existing monitoring for two weeks to establish agreement, then promote to production alerting. Keep it out of the user-facing liveness endpoint from day one — schedule it as a command or queued job.
Maintenance. Low ongoing effort, but not zero: budget a few hours per quarter to watch for Laravel major releases and dependency conflicts, and keep the package pinned with the lockfile committed. The correct posture is "vendored dependency we happen to install via Composer," with a named internal owner and a documented fork procedure. The 2024-03-28 release date means no upstream patches should be assumed.
Support. Community support is effectively nil at 17 stars. All troubleshooting lands on the adopting team. That is acceptable for a package this small, but it must be an explicit acceptance, not an accident — the code should be read end-to-end during evaluation precisely because there will be no upstream to explain it later.
Scaling. Cost scales linearly with the number of monitored domains and is dominated by network round-trips. Fifty serialised checks at 200–500 ms each is 10–25 seconds per run — fine as a background job, unacceptable inline in a request. Two constraints follow: (1) checks must run on a schedule with a bounded concurrency and per-check timeout, and (2) result caching with a TTL longer than the check interval keeps repeated runs cheap. Be considerate of targets: a high-frequency check against third-party hosts is a self-inflicted rate-limit risk.
Failure modes. Expect false positives from egress filtering, DNS resolution failures inside the cluster, SNI mismatches on shared-IP hosting, CDN edge certificates that rotate independently of origin certificates, and IPv6-only reachability where the runner is IPv4-only. Expect false negatives from an incomplete inventory, from checking the origin cert while traffic terminates at an edge, and from any check that validates expiry without validating chain completeness. Design the alerting so that a check error (couldn't evaluate) is distinguishable from a check failure (certificate is bad) — otherwise the first network hiccup trains the team to ignore the alert.
Ramp-up. Half a day for a mid-level Laravel developer to install, configure, and validate. The genuine ramp-up cost is organisational, not technical: someone must own the authoritative list of hostnames, agree the renewal-lead-time threshold, and define who acts when a check goes red. Without that, the package produces a signal with no response path, which is worse than no signal at all.
How can I help you explore Laravel packages today?