diff --git a/agents/meshcore.js b/agents/meshcore.js index 7d9a8373..426018d5 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -4022,7 +4022,7 @@ function agentUpdate_Start(updateurl, updateoptions) { return; } - if (sessionid != null) { sendConsoleText('Downloading update...', sessionid); } + if (sessionid != null) { sendConsoleText('Downloading update from: ' + updateurl, sessionid); } var options = require('http').parseUri(updateurl != null ? updateurl : require('MeshAgent').ServerUrl); options.protocol = 'https:'; if (updateurl == null) { options.path = ('/meshagents?id=' + require('MeshAgent').ARCHID); } @@ -4052,6 +4052,7 @@ function agentUpdate_Start(updateurl, updateoptions) { agentUpdate_Start._selfupdate.on('error', function (e) { sendConsoleText('Self Update failed, because there was a problem trying to download the update', sessionid); sendAgentMessage('Self Update failed, because there was a problem trying to download the update', 3); + agentUpdate_Start._selfupdate = null; }); agentUpdate_Start._selfupdate.on('response', function (img) { this._file = require('fs').createWriteStream(agentfilename + '.update', { flags: 'wb' }); diff --git a/agents/recoverycore.js b/agents/recoverycore.js index 8c83b8da..320e741e 100644 --- a/agents/recoverycore.js +++ b/agents/recoverycore.js @@ -399,6 +399,7 @@ function agentUpdate_Start(updateurl, updateoptions) { sendConsoleText('Self Update failed, because there was a problem trying to download the update', sessionid); sendAgentMessage('Self Update failed, because there was a problem trying to download the update', 3); + agentUpdate_Start._selfupdate = null; }); agentUpdate_Start._selfupdate.on('response', function (img) { diff --git a/meshagent.js b/meshagent.js index d83138a2..08a0a0d3 100644 --- a/meshagent.js +++ b/meshagent.js @@ -1179,7 +1179,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) { if (obj.agentExeInfo.fileHash != null) { cmd.hash = obj.agentExeInfo.fileHashHex; } else { cmd.hash = obj.agentExeInfo.hashhex; } // Add server TLS cert hash - if (parent.parent.args.ignoreagenthashcheck !== true) { + if (isIgnoreHashCheck() == false) { const tlsCertHash = parent.webCertificateFullHashs[domain.id]; if (tlsCertHash != null) { cmd.servertlshash = Buffer.from(tlsCertHash, 'binary').toString('hex'); } } @@ -1491,7 +1491,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) { if (obj.agentExeInfo.fileHash != null) { cmd.hash = obj.agentExeInfo.fileHashHex; } else { cmd.hash = obj.agentExeInfo.hashhex; } // Add server TLS cert hash - if (parent.parent.args.ignoreagenthashcheck !== true) { + if (isIgnoreHashCheck() == false) { const tlsCertHash = parent.webCertificateFullHashs[domain.id]; if (tlsCertHash != null) { cmd.servertlshash = Buffer.from(tlsCertHash, 'binary').toString('hex'); } } diff --git a/meshuser.js b/meshuser.js index 768d69c7..6a656f19 100644 --- a/meshuser.js +++ b/meshuser.js @@ -1344,7 +1344,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use // Add server TLS cert hash var tlsCertHash = null; - if (parent.parent.args.ignoreagenthashcheck !== true) { + if ((parent.parent.args.ignoreagenthashcheck == null) || (parent.parent.args.ignoreagenthashcheck === false)) { // TODO: If ignoreagenthashcheck is an array of IP addresses, not sure how to handle this. tlsCertHash = parent.webCertificateFullHashs[domain.id]; if (tlsCertHash != null) { command.servertlshash = Buffer.from(tlsCertHash, 'binary').toString('hex'); } } diff --git a/webserver.js b/webserver.js index 821080cc..2f44a273 100644 --- a/webserver.js +++ b/webserver.js @@ -3432,7 +3432,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { // Instruct one of more agents to download a URL to a given local drive location. var tlsCertHash = null; - if (parent.args.ignoreagenthashcheck !== true) { + if ((parent.args.ignoreagenthashcheck == null) || (parent.args.ignoreagenthashcheck === false)) { // TODO: If ignoreagenthashcheck is an array of IP addresses, not sure how to handle this. tlsCertHash = obj.webCertificateFullHashs[cmd.domain.id]; if (tlsCertHash != null) { tlsCertHash = Buffer.from(tlsCertHash, 'binary').toString('hex'); } }