mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-24 06:05:53 -05:00
Added selfsigned cert support to mysql/mariadb ssl
This commit is contained in:
parent
f3119dbc87
commit
dc75589bd3
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;
|
||||
|
@ -21,7 +21,16 @@
|
||||
"port": { "type": "number", "description": "MariaDB port number" },
|
||||
"password": { "type": "string", "description": "MariaDB password" },
|
||||
"connectionLimit": { "type": "number", "description": "MariaDB connection limit" },
|
||||
"database": { "type": "string", "default": "meshcentral", "description": "Name of MariaDB database used" }
|
||||
"database": { "type": "string", "default": "meshcentral", "description": "Name of MariaDB database used" },
|
||||
"ssl": {
|
||||
"type": "object",
|
||||
"description": "SSL Options. Set to true (boolean) for default options.",
|
||||
"properties": {
|
||||
"caCertPath": { "type": "string", "description": "Absolute path to the CA certificate. Required for self-signed certificates" },
|
||||
"clientCertPath": { "type": "string", "description": "Absolute path to the client certificate. Required for two-way SSL Authentication" },
|
||||
"clientKeyPath": { "type": "string", "description": "Absolute path to the client key. Required for two-way SSL Authentication" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"mySQL": {
|
||||
@ -32,7 +41,16 @@
|
||||
"port": { "type": "number", "description": "MySQL port number" },
|
||||
"user": { "type": "string", "description": "MySQL username" },
|
||||
"password": { "type": "string", "description": "MySQL password" },
|
||||
"database": { "type": "string", "default": "meshcentral", "description": "Name of MySQL database used" }
|
||||
"database": { "type": "string", "default": "meshcentral", "description": "Name of MySQL database used" },
|
||||
"ssl": {
|
||||
"type": "object",
|
||||
"description": "SSL Options. Set to true (boolean) for default options.",
|
||||
"properties": {
|
||||
"caCertPath": { "type": "string", "description": "Absolute path to the CA certificate. Required for self-signed certificates" },
|
||||
"clientCertPath": { "type": "string", "description": "Absolute path to the client certificate. Required for two-way SSL Authentication" },
|
||||
"clientKeyPath": { "type": "string", "description": "Absolute path to the client key. Required for two-way SSL Authentication" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"WANonly": { "type": "boolean", "default": false, "description": "When enabled, only MeshCentral WAN features are enabled and agents will connect to the server using a well known DNS name." },
|
||||
|
Loading…
Reference in New Issue
Block a user