From b7385e382c6be3ffcac8f44051fabb3e31a37692 Mon Sep 17 00:00:00 2001 From: Simon Smith Date: Tue, 7 Nov 2023 00:10:12 +0000 Subject: [PATCH] fix agentaliasdns display (#5518) --- webserver.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webserver.js b/webserver.js index f1814284..b9206089 100644 --- a/webserver.js +++ b/webserver.js @@ -7829,12 +7829,14 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF function StartAltWebServer(port, addr) { if ((port < 1) || (port > 65535)) return; var agentAliasPort = null; + var agentAliasDns = null; if (args.agentaliasport != null) { agentAliasPort = args.agentaliasport; } + if (args.agentaliasdns != null) { agentAliasDns = args.agentaliasdns; } if (obj.tlsAltServer != null) { if (obj.args.lanonly == true) { obj.tcpAltServer = obj.tlsAltServer.listen(port, addr, function () { console.log('MeshCentral HTTPS agent-only server running on port ' + port + ((agentAliasPort != null) ? (', alias port ' + agentAliasPort) : '') + '.'); }); } else { - obj.tcpAltServer = obj.tlsAltServer.listen(port, addr, function () { console.log('MeshCentral HTTPS agent-only server running on ' + certificates.CommonName + ':' + port + ((agentAliasPort != null) ? (', alias port ' + agentAliasPort) : '') + '.'); }); + obj.tcpAltServer = obj.tlsAltServer.listen(port, addr, function () { console.log('MeshCentral HTTPS agent-only server running on ' + ((agentAliasDns != null) ? agentAliasDns : certificates.CommonName) + ':' + port + ((agentAliasPort != null) ? (', alias port ' + agentAliasPort) : '') + '.'); }); } obj.parent.authLog('https', 'Server listening on 0.0.0.0 port ' + port + '.'); obj.parent.updateServerState('https-agent-port', port);