Fixed meshagent.txt when CertUrl is used.

This commit is contained in:
Ylian Saint-Hilaire 2019-04-10 11:54:55 -07:00
parent ff226d3f03
commit 68c9ee1d09
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "meshcentral", "name": "meshcentral",
"version": "0.3.2-d", "version": "0.3.2-f",
"keywords": [ "keywords": [
"Remote Management", "Remote Management",
"Intel AMT", "Intel AMT",

View File

@ -2185,6 +2185,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
obj.db.Get(req.query.nodeid, function (err, nodes) { obj.db.Get(req.query.nodeid, function (err, nodes) {
if (nodes.length != 1) { res.sendStatus(401); return; } if (nodes.length != 1) { res.sendStatus(401); return; }
var node = nodes[0]; var node = nodes[0];
// Create the meshaction.txt file for meshcmd.exe // Create the meshaction.txt file for meshcmd.exe
var meshaction = { var meshaction = {
action: req.query.meshaction, action: req.query.meshaction,
@ -2195,7 +2196,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
username: '', username: '',
password: '', password: '',
serverId: obj.agentCertificateHashHex.toUpperCase(), // SHA384 of server HTTPS public key serverId: obj.agentCertificateHashHex.toUpperCase(), // SHA384 of server HTTPS public key
serverHttpsHash: Buffer.from(obj.webCertificateHash, 'binary').toString('hex').toUpperCase(), // SHA384 of server HTTPS certificate serverHttpsHash: Buffer.from(obj.webCertificateHashs[domain.id], 'binary').toString('hex').toUpperCase(), // SHA384 of server HTTPS certificate
debugLevel: 0 debugLevel: 0
}; };
if (user != null) { meshaction.username = user.name; } if (user != null) { meshaction.username = user.name; }
@ -2210,7 +2211,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
username: '', username: '',
password: '', password: '',
serverId: obj.agentCertificateHashHex.toUpperCase(), // SHA384 of server HTTPS public key serverId: obj.agentCertificateHashHex.toUpperCase(), // SHA384 of server HTTPS public key
serverHttpsHash: Buffer.from(obj.webCertificateHash, 'binary').toString('hex').toUpperCase(), // SHA384 of server HTTPS certificate serverHttpsHash: Buffer.from(obj.webCertificateHashs[domain.id], 'binary').toString('hex').toUpperCase(), // SHA384 of server HTTPS certificate
debugLevel: 0 debugLevel: 0
}; };
if (user != null) { meshaction.username = user.name; } if (user != null) { meshaction.username = user.name; }