mirror of
https://github.com/databasus/databasus.git
synced 2026-04-06 00:32:03 +02:00
feat(mongodb): add support for custom tls cert #222
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @itsmenewbie03 on 1/16/2026
What
This change adds support for custom TLS/SSL certificates when connecting to MongoDB databases during backup and restore operations.
Why
This enables secure connections to MongoDB instances that require certificate-based authentication, supporting both server verification via a CA certificate and mutual TLS using a client certificate and private key. This is necessary for environments where TLS is mandatory.
How
On the backend, new tls_ca_file, tls_cert_file, and tls_cert_key_file fields were added to the database schema, and the backup/restore logic was updated to write the provided certificates to temporary files and pass them to mongodump and mongorestore. The same TLS handling is also implemented in the MongoDB connection tester to ensure connectivity checks accurately reflect production behavior. On the frontend, three optional textarea inputs were added to the MongoDB configuration UI to allow pasting PEM-encoded certificates. All TLS fields are optional, so existing configurations continue to work without any changes.