------
Call "tmpdir()" a single time inside "database.js" and remove "caFilePath" from the config if the path starts with the temporary directory path as a failsafe
Fix whitespace
Move the unassignment of " dbConfig.ssl" and " dbConfig.ssl" outside the block responsible to move the CA file from the temporary directory to the data directory
Fix inverted "if" condition. Also add "path.resolve" to a path check in order to make sure that we are comparing absolute paths with each others
Remove unnecessary check for a ".pem" file, simplify the path check and fix the file copying to itself
Add additional path checks to avoid filename exploits
Fix issue where the temp directory used to temporarily store the CA file is within the working directory instead of the OS provided temp directory path