diff --git a/app/Jobs/ProvisionHostingSslJob.php b/app/Jobs/ProvisionHostingSslJob.php index 052d68a..e305be3 100644 --- a/app/Jobs/ProvisionHostingSslJob.php +++ b/app/Jobs/ProvisionHostingSslJob.php @@ -70,6 +70,9 @@ class ProvisionHostingSslJob implements ShouldQueue 'site_id' => $this->siteId, 'domain' => $site->domain, ]); + + // Record the cert in Ladill Domains' central SSL registry (best-effort). + app(\App\Services\Ssl\CentralSslRegistry::class)->register($site->domain, $site->ssl_expires_at); } catch (\Throwable $exception) { $message = $exception->getMessage(); diff --git a/app/Services/Ssl/CentralSslRegistry.php b/app/Services/Ssl/CentralSslRegistry.php new file mode 100644 index 0000000..d72fb40 --- /dev/null +++ b/app/Services/Ssl/CentralSslRegistry.php @@ -0,0 +1,34 @@ +acceptJson()->timeout(10) + ->post($url.'/ssl/register', array_filter([ + 'host' => $host, + 'status' => 'active', + 'expires_at' => $expiresAt?->format(DATE_ATOM), + ])); + } catch (\Throwable $e) { + Log::info('CentralSslRegistry: register skipped', ['host' => $host, 'error' => $e->getMessage()]); + } + } +}