fix(ssl): ger caCert and mountPath correctly
This commit is contained in:
@@ -169,10 +169,7 @@ class General extends Component
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$caCertificate = SslCertificate::where('server_id', $this->server->id)
|
$caCert = SslCertificate::where('server_id', $existingCert->server_id)->where('is_ca_certificate', true)->first();
|
||||||
->where('resource_type', null)
|
|
||||||
->where('resource_id', null)
|
|
||||||
->first();
|
|
||||||
|
|
||||||
SslHelper::generateSslCertificate(
|
SslHelper::generateSslCertificate(
|
||||||
commonName: $existingCert->common_name,
|
commonName: $existingCert->common_name,
|
||||||
@@ -180,10 +177,10 @@ class General extends Component
|
|||||||
resourceType: $existingCert->resource_type,
|
resourceType: $existingCert->resource_type,
|
||||||
resourceId: $existingCert->resource_id,
|
resourceId: $existingCert->resource_id,
|
||||||
serverId: $existingCert->server_id,
|
serverId: $existingCert->server_id,
|
||||||
caCert: $caCertificate->ssl_certificate,
|
caCert: $caCert->ssl_certificate,
|
||||||
caKey: $caCertificate->ssl_private_key,
|
caKey: $caCert->ssl_private_key,
|
||||||
configurationDir: $existingCert->configuration_dir,
|
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.');
|
$this->dispatch('success', 'SSL certificates have been regenerated. Please restart the database for changes to take effect.');
|
||||||
|
|||||||
@@ -169,10 +169,7 @@ class General extends Component
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$caCertificate = SslCertificate::where('server_id', $this->server->id)
|
$caCert = SslCertificate::where('server_id', $existingCert->server_id)->where('is_ca_certificate', true)->first();
|
||||||
->where('resource_type', null)
|
|
||||||
->where('resource_id', null)
|
|
||||||
->first();
|
|
||||||
|
|
||||||
SslHelper::generateSslCertificate(
|
SslHelper::generateSslCertificate(
|
||||||
commonName: $existingCert->common_name,
|
commonName: $existingCert->common_name,
|
||||||
@@ -180,10 +177,10 @@ class General extends Component
|
|||||||
resourceType: $existingCert->resource_type,
|
resourceType: $existingCert->resource_type,
|
||||||
resourceId: $existingCert->resource_id,
|
resourceId: $existingCert->resource_id,
|
||||||
serverId: $existingCert->server_id,
|
serverId: $existingCert->server_id,
|
||||||
caCert: $caCertificate->ssl_certificate,
|
caCert: $caCert->ssl_certificate,
|
||||||
caKey: $caCertificate->ssl_private_key,
|
caKey: $caCert->ssl_private_key,
|
||||||
configurationDir: $existingCert->configuration_dir,
|
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.');
|
$this->dispatch('success', 'SSL certificates have been regenerated. Please restart the database for changes to take effect.');
|
||||||
|
|||||||
@@ -133,10 +133,7 @@ class General extends Component
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$caCertificate = SslCertificate::where('server_id', $this->server->id)
|
$caCert = SslCertificate::where('server_id', $existingCert->server_id)->where('is_ca_certificate', true)->first();
|
||||||
->where('resource_type', null)
|
|
||||||
->where('resource_id', null)
|
|
||||||
->first();
|
|
||||||
|
|
||||||
SslHelper::generateSslCertificate(
|
SslHelper::generateSslCertificate(
|
||||||
commonName: $existingCert->common_name,
|
commonName: $existingCert->common_name,
|
||||||
@@ -144,10 +141,10 @@ class General extends Component
|
|||||||
resourceType: $existingCert->resource_type,
|
resourceType: $existingCert->resource_type,
|
||||||
resourceId: $existingCert->resource_id,
|
resourceId: $existingCert->resource_id,
|
||||||
serverId: $existingCert->server_id,
|
serverId: $existingCert->server_id,
|
||||||
caCert: $caCertificate->ssl_certificate,
|
caCert: $caCert->ssl_certificate,
|
||||||
caKey: $caCertificate->ssl_private_key,
|
caKey: $caCert->ssl_private_key,
|
||||||
configurationDir: $existingCert->configuration_dir,
|
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.');
|
$this->dispatch('success', 'SSL certificates have been regenerated. Please restart the database for changes to take effect.');
|
||||||
|
|||||||
Reference in New Issue
Block a user