fix(ssl): ger caCert and mountPath correctly

This commit is contained in:
peaklabs-dev
2025-02-07 18:30:07 +01:00
parent 836006798f
commit 62fb2c2877
3 changed files with 12 additions and 21 deletions

View File

@@ -169,10 +169,7 @@ class General extends Component
return;
}
$caCertificate = SslCertificate::where('server_id', $this->server->id)
->where('resource_type', null)
->where('resource_id', null)
->first();
$caCert = SslCertificate::where('server_id', $existingCert->server_id)->where('is_ca_certificate', true)->first();
SslHelper::generateSslCertificate(
commonName: $existingCert->common_name,
@@ -180,10 +177,10 @@ class General extends Component
resourceType: $existingCert->resource_type,
resourceId: $existingCert->resource_id,
serverId: $existingCert->server_id,
caCert: $caCertificate->ssl_certificate,
caKey: $caCertificate->ssl_private_key,
caCert: $caCert->ssl_certificate,
caKey: $caCert->ssl_private_key,
configurationDir: $existingCert->configuration_dir,
mountPath: '/var/lib/mysql/certs',
mountPath: $existingCert->mount_path,
);
$this->dispatch('success', 'SSL certificates have been regenerated. Please restart the database for changes to take effect.');

View File

@@ -169,10 +169,7 @@ class General extends Component
return;
}
$caCertificate = SslCertificate::where('server_id', $this->server->id)
->where('resource_type', null)
->where('resource_id', null)
->first();
$caCert = SslCertificate::where('server_id', $existingCert->server_id)->where('is_ca_certificate', true)->first();
SslHelper::generateSslCertificate(
commonName: $existingCert->common_name,
@@ -180,10 +177,10 @@ class General extends Component
resourceType: $existingCert->resource_type,
resourceId: $existingCert->resource_id,
serverId: $existingCert->server_id,
caCert: $caCertificate->ssl_certificate,
caKey: $caCertificate->ssl_private_key,
caCert: $caCert->ssl_certificate,
caKey: $caCert->ssl_private_key,
configurationDir: $existingCert->configuration_dir,
mountPath: '/var/lib/mysql/certs',
mountPath: $existingCert->mount_path,
);
$this->dispatch('success', 'SSL certificates have been regenerated. Please restart the database for changes to take effect.');

View File

@@ -133,10 +133,7 @@ class General extends Component
return;
}
$caCertificate = SslCertificate::where('server_id', $this->server->id)
->where('resource_type', null)
->where('resource_id', null)
->first();
$caCert = SslCertificate::where('server_id', $existingCert->server_id)->where('is_ca_certificate', true)->first();
SslHelper::generateSslCertificate(
commonName: $existingCert->common_name,
@@ -144,10 +141,10 @@ class General extends Component
resourceType: $existingCert->resource_type,
resourceId: $existingCert->resource_id,
serverId: $existingCert->server_id,
caCert: $caCertificate->ssl_certificate,
caKey: $caCertificate->ssl_private_key,
caCert: $caCert->ssl_certificate,
caKey: $caCert->ssl_private_key,
configurationDir: $existingCert->configuration_dir,
mountPath: '/var/lib/postgresql/certs',
mountPath: $existingCert->mount_path,
);
$this->dispatch('success', 'SSL certificates have been regenerated. Please restart the database for changes to take effect.');