fix: connection ssl require file path instread of file content

This commit is contained in:
Muhammad Hussein Fattahizadeh
2023-02-22 18:53:41 +03:30
parent 675ef6e593
commit 0c6e113e3e
2 changed files with 6 additions and 2 deletions

View File

@@ -68,10 +68,11 @@ const driver = {
};
if (ssl) {
options.tls = true;
options.tlsCAFile = ssl.ca;
options.tlsCertificateKeyFile = ssl.cert || ssl.key;
options.tlsCAFile = ssl.sslCaFile;
options.tlsCertificateKeyFile = ssl.sslCertFile || ssl.sslKeyFile;
options.tlsCertificateKeyFilePassword = ssl.password;
options.tlsAllowInvalidCertificates = !ssl.rejectUnauthorized;
options.tlsInsecure = !ssl.rejectUnauthorized;
}
const pool = new MongoClient(mongoUrl, options);