MeshCmd cert auth fix.

Ylian Saint-Hilaire committed May 25, 2021 at 16:35 UTC 428efb3f1bc377cafa55f8ea8ee736b0d578db92
1 file changed +1 -1
agents/meshcmd.js
+1 -1
@@ -70,7 +70,7 @@ function onVerifyServer(clientName, certs) {
70 if (certs == null) { certs = clientName; } // Temporary thing until we fix duktape
71
72 // If we have the serverid, used delayed server authentication
73 - if (settings.serverid != null) { settings.meshServerTlsHash = certs[certs.length - 1].fingerprint.replace(/:/g, ''); return; }
73 + if (settings.serverid != null) { settings.meshServerTlsHash = certs[0].fingerprint.replace(/:/g, ''); return; }
74
75 // Otherwise, use server HTTPS certificate hash
76 try { for (var i in certs) { if (certs[i].fingerprint.replace(/:/g, '') == settings.serverhttpshash) { return; } } } catch (e) { }