diff --git a/agents/meshcmd.js b/agents/meshcmd.js index 89b26c1f..518ecdb0 100644 --- a/agents/meshcmd.js +++ b/agents/meshcmd.js @@ -47,7 +47,7 @@ var amtMeiTmpState = null; var SMBiosTables = null; var globalDebugFlags = 0; // 1 = IDER Debug var pendingAmtConfigActions = 0; -const RCSMessageProtocolVersion = 1; // RCS Message Protocol Version. Needs to be less than or equal to RCS server Message Protocol Version +var RCSMessageProtocolVersion = 1; // RCS Message Protocol Version. Needs to be less than or equal to RCS server Message Protocol Version // MeshCommander for Firmware (GZIP'ed, Base64) v0.7.8 var Large_IntelAmtWebApp_etag = "zVObfGF4CXPIxvxSUu+3"; diff --git a/agents/meshcmd.min.js b/agents/meshcmd.min.js index 89b26c1f..518ecdb0 100644 --- a/agents/meshcmd.min.js +++ b/agents/meshcmd.min.js @@ -47,7 +47,7 @@ var amtMeiTmpState = null; var SMBiosTables = null; var globalDebugFlags = 0; // 1 = IDER Debug var pendingAmtConfigActions = 0; -const RCSMessageProtocolVersion = 1; // RCS Message Protocol Version. Needs to be less than or equal to RCS server Message Protocol Version +var RCSMessageProtocolVersion = 1; // RCS Message Protocol Version. Needs to be less than or equal to RCS server Message Protocol Version // MeshCommander for Firmware (GZIP'ed, Base64) v0.7.8 var Large_IntelAmtWebApp_etag = "zVObfGF4CXPIxvxSUu+3"; diff --git a/agents/meshcore.js b/agents/meshcore.js index eb6b4e78..807bcbf7 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -1671,16 +1671,6 @@ function createMeshCore(agent) break; } /* - case 'npm': { - var child = require('child_process').execFile('C:\\Program Files\\nodejs\\node.exe', ['node.exe', '-v']); - child.stdout.str = ''; - child.stdout.on('data', function (chunk) { this.str += chunk.toString(); }); - child.waitExit(); - response = 'Response: ' + child.stdout.str; - break; - } - */ - /* case 'border': { if ((args['_'].length == 1) && (args['_'][0] == 'on')) { diff --git a/agents/meshcore.min.js b/agents/meshcore.min.js index eb6b4e78..807bcbf7 100644 --- a/agents/meshcore.min.js +++ b/agents/meshcore.min.js @@ -1671,16 +1671,6 @@ function createMeshCore(agent) break; } /* - case 'npm': { - var child = require('child_process').execFile('C:\\Program Files\\nodejs\\node.exe', ['node.exe', '-v']); - child.stdout.str = ''; - child.stdout.on('data', function (chunk) { this.str += chunk.toString(); }); - child.waitExit(); - response = 'Response: ' + child.stdout.str; - break; - } - */ - /* case 'border': { if ((args['_'].length == 1) && (args['_'][0] == 'on')) { diff --git a/meshmail.js b/meshmail.js index 9418d901..29275031 100644 --- a/meshmail.js +++ b/meshmail.js @@ -32,9 +32,11 @@ module.exports.CreateMeshMail = function (parent) { //function EscapeHtmlBreaks(x) { if (typeof x == "string") return x.replace(/&/g, '&').replace(/>/g, '>').replace(/').replace(/\n/g, '').replace(/\t/g, '  '); if (typeof x == "boolean") return x; if (typeof x == "number") return x; } // Setup mail server - var options = { host: parent.config.smtp.host, secure: (parent.config.smtp.tls == true) }; + var options = { host: parent.config.smtp.host, secure: (parent.config.smtp.tls == true), tls: { } }; //var options = { host: parent.config.smtp.host, secure: (parent.config.smtp.tls == true), tls: { secureProtocol: 'SSLv23_method', ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_COMPRESSION | constants.SSL_OP_CIPHER_SERVER_PREFERENCE, rejectUnauthorized: false } }; if (parent.config.smtp.port != null) { options.port = parent.config.smtp.port; } + if (parent.config.smtp.tlscertcheck === false) { options.tls.rejectUnauthorized = false; } + if (parent.config.smtp.tlsstrict === true) { options.tls.secureProtocol = 'SSLv23_method'; options.tls.ciphers = 'RSA+AES:!aNULL:!MD5:!DSS'; options.tls.secureOptions = constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_COMPRESSION | constants.SSL_OP_CIPHER_SERVER_PREFERENCE; } if ((parent.config.smtp.user != null) && (parent.config.smtp.pass != null)) { options.auth = { user: parent.config.smtp.user, pass: parent.config.smtp.pass }; } obj.smtpServer = nodemailer.createTransport(options); diff --git a/package.json b/package.json index bb4347bb..6e105a92 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.4.0-v", + "version": "0.4.0-w", "keywords": [ "Remote Management", "Intel AMT", diff --git a/sample-config.json b/sample-config.json index a8f3caf1..7d985bd8 100644 --- a/sample-config.json +++ b/sample-config.json @@ -145,6 +145,11 @@ "host": "smtp.myserver.com", "port": 25, "from": "myemail@myserver.com", - "tls": false + "__tls__": "When 'tls' is set to true, TLS is used immidiatly when connecting. For SMTP servers that use TLSSTART, set this to 'false' and TLS will still be used.", + "tls": false, + "___tlscertcheck__": "When set to false, the TLS certificate of the SMTP server is not checked.", + "_tlscertcheck": false, + "__tlsstrict__": "When set to true, TLS cypher setup is more limited, SSLv2 and SSLv3 are not allowed.", + "_tlsstrict": true } } diff --git a/webserver.js b/webserver.js index 3b436fda..12c84f5d 100644 --- a/webserver.js +++ b/webserver.js @@ -1514,8 +1514,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { if ((!obj.args.user) && (obj.args.nousers != true) && (nologout == false)) { logoutcontrol += ' Logout'; } // If a default user is in use or no user mode, don't display the logout button var httpsPort = ((obj.args.aliasport == null) ? obj.args.port : obj.args.aliasport); // Use HTTPS alias port is specified - // Clean up the U2F challenge is needed - //if (req.session.u2fchallenge) { delete req.session.u2fchallenge; }; + // Clean up the U2F challenge if needed + if (req.session.u2fchallenge) { delete req.session.u2fchallenge; }; // Fetch the web state parent.debug('web', 'handleRootRequestEx: success.');