feat(database): add CA certificate generation for database servers

This commit is contained in:
Andras Bacsai
2025-03-31 14:02:15 +02:00
parent c7591fde15
commit d6d1c9ad82
9 changed files with 129 additions and 1 deletions

View File

@@ -59,6 +59,17 @@ class StartMysql
$server = $this->database->destination->server;
$caCert = SslCertificate::where('server_id', $server->id)->where('is_ca_certificate', true)->first();
if (! $caCert) {
$server->generateCaCertificate();
$caCert = SslCertificate::where('server_id', $server->id)->where('is_ca_certificate', true)->first();
}
if (! $caCert) {
$this->dispatch('error', 'No CA certificate found for this database. Please generate a CA certificate for this server in the server/advanced page.');
return;
}
$this->ssl_certificate = $this->database->sslCertificates()->first();
if (! $this->ssl_certificate) {