fix(ssl): get caCert correctly

This commit is contained in:
peaklabs-dev
2025-02-07 18:27:30 +01:00
parent 69a6010839
commit 6a52f51851
4 changed files with 11 additions and 16 deletions

View File

@@ -62,9 +62,9 @@ class StartPostgresql
} else {
$this->commands[] = "echo 'Setting up SSL for this database.'";
$this->commands[] = "mkdir -p $this->configuration_dir/ssl";
$server = $this->database->destination->server;
$caCert = SslCertificate::where('server_id', $server->id)->firstOrFail();
$server = $this->database->destination->server;
$caCert = SslCertificate::where('server_id', $server->server_id)->where('is_ca_certificate', true)->first();
$this->ssl_certificate = SslCertificate::where('resource_type', $this->database->getMorphClass())->where('resource_id', $this->database->id)->first();