mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Added selfsigned cert support to mysql/mariadb ssl
This commit is contained in:
parent
f3119dbc87
commit
dc75589bd3
2 changed files with 29 additions and 2 deletions
9
db.js
9
db.js
|
@ -446,6 +446,15 @@ module.exports.CreateDB = function (parent, func) {
|
|||
var connectionObject = Clone(connectinArgs);
|
||||
delete connectionObject.database;
|
||||
|
||||
try {
|
||||
if (connectinArgs.ssl.cacertpath) { connectionObject.ssl.ca = [require('fs').readFileSync(connectinArgs.ssl.cacertpath, 'utf8')]; }
|
||||
if (connectinArgs.ssl.clientcertpath) { connectionObject.ssl.cert = [require('fs').readFileSync(connectinArgs.ssl.clientcertpath, 'utf8')]; }
|
||||
if (connectinArgs.ssl.clientkeypath) { connectionObject.ssl.key = [require('fs').readFileSync(connectinArgs.ssl.clientkeypath, 'utf8')]; }
|
||||
} catch (ex) {
|
||||
console.log('Error loading SQL Connector certificate: ' + ex);
|
||||
process.exit();
|
||||
}
|
||||
|
||||
if (parent.args.mariadb) {
|
||||
// Use MariaDB
|
||||
obj.databaseType = 4;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue