mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-26 07:05:52 -05:00
bug fixes checking ssl properties
This commit is contained in:
parent
e21077b064
commit
791afb5035
20
db.js
20
db.js
@ -447,9 +447,11 @@ module.exports.CreateDB = function (parent, func) {
|
|||||||
delete connectionObject.database;
|
delete connectionObject.database;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (connectinArgs.ssl.cacertpath) { connectionObject.ssl.ca = [require('fs').readFileSync(connectinArgs.ssl.cacertpath, 'utf8')]; }
|
if (connectinArgs.ssl) {
|
||||||
if (connectinArgs.ssl.clientcertpath) { connectionObject.ssl.cert = [require('fs').readFileSync(connectinArgs.ssl.clientcertpath, 'utf8')]; }
|
if (connectinArgs.ssl.cacertpath) { connectionObject.ssl.ca = [require('fs').readFileSync(connectinArgs.ssl.cacertpath, 'utf8')]; }
|
||||||
if (connectinArgs.ssl.clientkeypath) { connectionObject.ssl.key = [require('fs').readFileSync(connectinArgs.ssl.clientkeypath, '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) {
|
} catch (ex) {
|
||||||
console.log('Error loading SQL Connector certificate: ' + ex);
|
console.log('Error loading SQL Connector certificate: ' + ex);
|
||||||
process.exit();
|
process.exit();
|
||||||
@ -1596,11 +1598,15 @@ module.exports.CreateDB = function (parent, func) {
|
|||||||
// SSL options different on mariadb/mysql
|
// SSL options different on mariadb/mysql
|
||||||
var sslOptions = '';
|
var sslOptions = '';
|
||||||
if (obj.databaseType == 4) {
|
if (obj.databaseType == 4) {
|
||||||
if (props.ssl) sslOptions = ' --ssl';
|
if (props.ssl) {
|
||||||
if (props.ssl.cacertpath) sslOptions = ' --ssl-verify-server-cert --ssl-ca=' + props.ssl.cacertpath;
|
sslOptions = ' --ssl';
|
||||||
|
if (props.ssl.cacertpath) sslOptions = ' --ssl-verify-server-cert --ssl-ca=' + props.ssl.cacertpath;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (props.ssl) sslOptions = ' --ssl-mode=required';
|
if (props.ssl) {
|
||||||
if (props.ssl.cacertpath) sslOptions = ' --ssl-mode=verify_identity --ssl-ca=' + props.ssl.cacertpath;
|
sslOptions = ' --ssl-mode=required';
|
||||||
|
if (props.ssl.cacertpath) sslOptions = ' --ssl-mode=verify_identity --ssl-ca=' + props.ssl.cacertpath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cmd += sslOptions;
|
cmd += sslOptions;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user