1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-02-12 11:01:52 +00:00

Improved server peering auth debug message.

This commit is contained in:
Ylian Saint-Hilaire 2023-09-24 13:31:08 -07:00
parent dabd0e3808
commit 352b5d4d64

View file

@ -101,7 +101,7 @@ module.exports.CreateMultiServer = function (parent, args) {
switch (cmd) { switch (cmd) {
case 1: { case 1: {
// Server authentication request // Server authentication request
if (msg.length != 98) { obj.parent.parent.debug('peer', 'OutPeer: BAD MESSAGE(A1)'); return; } if (msg.length != 98) { obj.parent.parent.debug('peer', 'OutPeer: Bad server authentication message, length = ' + msg.length + ', should be 98. HEX: ' + Buffer.from(msg.substring(0, 4096), 'binary').toString('hex')); return; }
// Check that the server hash matches the TLS server certificate public key hash // Check that the server hash matches the TLS server certificate public key hash
if (obj.url.toLowerCase().startsWith('wss://') && (obj.serverCertHash != msg.substring(2, 50))) { obj.parent.parent.debug('peer', 'OutPeer: Server hash mismatch.'); disconnect(); return; } if (obj.url.toLowerCase().startsWith('wss://') && (obj.serverCertHash != msg.substring(2, 50))) { obj.parent.parent.debug('peer', 'OutPeer: Server hash mismatch.'); disconnect(); return; }