Possible fix for server peering auth problem, #5373

Ylian Saint-Hilaire committed Sep 24, 2023 at 13:41 UTC aed96a84e38dacb0362470181c51fc865dc6c78d
1 file changed +2 -2
multiserver.js
+2 -2
@@ -86,7 +86,7 @@ module.exports.CreateMultiServer = function (parent, args) {
86
87 // Start authenticate the peer server by sending a auth nonce & server TLS cert hash.
88 // Send 384 bits SHA384 hash of TLS cert public key + 384 bits nonce
89 - obj.ws.send(obj.common.ShortToStr(1) + obj.serverCertHash + obj.nonce); // Command 1, hash + nonce
89 + obj.ws.send(Buffer.from(obj.common.ShortToStr(1) + obj.serverCertHash + obj.nonce, 'binary')); // Command 1, hash + nonce
90 });
91
92 // If a message is received
@@ -110,7 +110,7 @@ module.exports.CreateMultiServer = function (parent, args) {
110 // Perform the hash signature using the server agent certificate
111 obj.parent.parent.certificateOperations.acceleratorPerformSignature(0, msg.substring(2) + obj.nonce, null, function (tag, signature) {
112 // Send back our certificate + signature
113 - if (obj.ws != null) { obj.ws.send(obj.common.ShortToStr(2) + obj.common.ShortToStr(obj.agentCertificateAsn1.length) + obj.agentCertificateAsn1 + signature); } // Command 2, certificate + signature
113 + if (obj.ws != null) { obj.ws.send(Buffer.from(obj.common.ShortToStr(2) + obj.common.ShortToStr(obj.agentCertificateAsn1.length) + obj.agentCertificateAsn1 + signature, 'binary')); } // Command 2, certificate + signature
114 });
115
116 break;