From 45de33fbaef935051cc6b070dbca1abcf44ad638 Mon Sep 17 00:00:00 2001 From: "flamingo[bot]" <277372822+flamingo[bot]@users.noreply.github.com> Date: Mon, 7 Sep 2026 05:15:03 +0000 Subject: [PATCH] fix(MESHCENT-002): Unwrapped this.write() for no-client-cert response in swarmserver.js --- swarmserver.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/swarmserver.js b/swarmserver.js index 4bd1ae075..9aee7c613 100644 --- a/swarmserver.js +++ b/swarmserver.js @@ -176,7 +176,7 @@ module.exports.CreateSwarmServer = function (parent, db, args, certificates) { // A client certificate is required if ((this.tag.clientCert == null) || (this.tag.clientCert.subject == null)) { /*console.log("Swarm Connection, no client cert: " + socket.remoteAddress);*/ - this.write('HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nConnection: close\r\n\r\nMeshCentral2 legacy swarm server.\r\nNo client certificate given.'); + try { this.write('HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nConnection: close\r\n\r\nMeshCentral2 legacy swarm server.\r\nNo client certificate given.'); } catch (ex) { } //this.end(); // If we don't close the connection, it may lead to less reconnection traffic. return; } @@ -432,3 +432,4 @@ module.exports.CreateSwarmServer = function (parent, db, args, certificates) { return obj; }; +