refactor(database): update MongoDB SSL configuration for improved security
This commit is contained in:
parent
637c3982d1
commit
5693b59874
1 changed files with 4 additions and 4 deletions
|
|
@ -248,9 +248,9 @@ protected function internalDbUrl(): Attribute
|
|||
$encodedPass = rawurlencode($this->mongo_initdb_root_password);
|
||||
$url = "mongodb://{$encodedUser}:{$encodedPass}@{$this->uuid}:27017/?directConnection=true";
|
||||
if ($this->enable_ssl) {
|
||||
$url .= '&tls=true';
|
||||
$url .= '&tls=true&tlsCAFile=/etc/mongo/certs/ca.pem';
|
||||
if (in_array($this->ssl_mode, ['verify-full'])) {
|
||||
$url .= '&tlsCAFile=/etc/ssl/certs/coolify-ca.crt';
|
||||
$url .= '&tlsCertificateKeyFile=/etc/mongo/certs/server.pem';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -268,9 +268,9 @@ protected function externalDbUrl(): Attribute
|
|||
$encodedPass = rawurlencode($this->mongo_initdb_root_password);
|
||||
$url = "mongodb://{$encodedUser}:{$encodedPass}@{$this->destination->server->getIp}:{$this->public_port}/?directConnection=true";
|
||||
if ($this->enable_ssl) {
|
||||
$url .= '&tls=true';
|
||||
$url .= '&tls=true&tlsCAFile=/etc/mongo/certs/ca.pem';
|
||||
if (in_array($this->ssl_mode, ['verify-full'])) {
|
||||
$url .= '&tlsCAFile=/etc/ssl/certs/coolify-ca.crt';
|
||||
$url .= '&tlsCertificateKeyFile=/etc/mongo/certs/server.pem';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue