1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Added NGNX reverse-proxy support.

This commit is contained in:
Ylian Saint-Hilaire 2018-11-01 15:01:21 -07:00
parent 829d2e9c83
commit 36cddd5652
5 changed files with 39 additions and 42 deletions

View file

@ -416,9 +416,11 @@ function CreateMeshCentralServer(config, args) {
var forgeCert = obj.certificateOperations.forge.pki.certificateFromAsn1(obj.certificateOperations.forge.asn1.fromDer(cert.raw.toString('binary')));
var hash = obj.certificateOperations.forge.pki.getPublicKeyFingerprint(forgeCert.publicKey, { md: obj.certificateOperations.forge.md.sha384.create(), encoding: 'hex' });
xdomain.certhash = hash;
console.log('Loaded RSA web certificate at ' + url + ', SHA384: ' + xdomain.certhash + '.');
} catch (ex) {
// This may be a ECDSA certificate, hash the entire cert
xdomain.certhash = obj.crypto.createHash('sha384').update(cert.raw).digest('hex');
console.log('Loaded non-RSA web certificate at ' + url + ', SHA384: ' + xdomain.certhash + '.');
}
} else {
console.log('Failed to load web certificate at: ' + url);