mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-11 23:13:21 -05:00
Fix for Node 11.10 deprecation of require('constants').
This commit is contained in:
parent
887f2ba22e
commit
93367b159d
@ -21,7 +21,6 @@ module.exports.CreateAmtScanner = function (parent) {
|
|||||||
obj.net = require('net');
|
obj.net = require('net');
|
||||||
obj.tls = require('tls');
|
obj.tls = require('tls');
|
||||||
obj.dns = require('dns');
|
obj.dns = require('dns');
|
||||||
obj.constants = require('constants');
|
|
||||||
obj.dgram = require('dgram');
|
obj.dgram = require('dgram');
|
||||||
obj.common = require('./common.js');
|
obj.common = require('./common.js');
|
||||||
obj.servers = {};
|
obj.servers = {};
|
||||||
@ -36,6 +35,7 @@ module.exports.CreateAmtScanner = function (parent) {
|
|||||||
obj.nextTag = 0;
|
obj.nextTag = 0;
|
||||||
const PeriodicScanTime = 30000; // Interval between scan sweeps
|
const PeriodicScanTime = 30000; // Interval between scan sweeps
|
||||||
const PeriodicScanTimeout = 65000; // After this time, timeout the device.
|
const PeriodicScanTimeout = 65000; // After this time, timeout the device.
|
||||||
|
const constants = (require('crypto').constants ? require('crypto').constants : require('constants')); // require('constants') is deprecated in Node 11.10, use require('crypto').constants instead.
|
||||||
|
|
||||||
// Build a RMCP packet with a given tag field
|
// Build a RMCP packet with a given tag field
|
||||||
obj.buildRmcpPing = function (tag) {
|
obj.buildRmcpPing = function (tag) {
|
||||||
@ -371,7 +371,7 @@ module.exports.CreateAmtScanner = function (parent) {
|
|||||||
} else {
|
} else {
|
||||||
// Connect using TLS, we will switch from default TLS to TLS1-only and back if we get a connection error to support older Intel AMT.
|
// Connect using TLS, we will switch from default TLS to TLS1-only and back if we get a connection error to support older Intel AMT.
|
||||||
if (scaninfo.tlsoption == null) { scaninfo.tlsoption = 0; }
|
if (scaninfo.tlsoption == null) { scaninfo.tlsoption = 0; }
|
||||||
client = obj.tls.connect(port, host, scaninfo.tlsoption == 1 ? { secureProtocol: 'TLSv1_method', rejectUnauthorized: false, ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: obj.constants.SSL_OP_NO_SSLv2 | obj.constants.SSL_OP_NO_SSLv3 | obj.constants.SSL_OP_NO_COMPRESSION | obj.constants.SSL_OP_CIPHER_SERVER_PREFERENCE } : { rejectUnauthorized: false, ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: obj.constants.SSL_OP_NO_SSLv2 | obj.constants.SSL_OP_NO_SSLv3 | obj.constants.SSL_OP_NO_COMPRESSION | obj.constants.SSL_OP_CIPHER_SERVER_PREFERENCE }, function () { this.write('GET / HTTP/1.1\r\nhost: ' + host + '\r\n\r\n'); });
|
client = obj.tls.connect(port, host, scaninfo.tlsoption == 1 ? { secureProtocol: 'TLSv1_method', rejectUnauthorized: false, ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_COMPRESSION | constants.SSL_OP_CIPHER_SERVER_PREFERENCE } : { rejectUnauthorized: false, ciphers: 'RSA+AES:!aNULL:!MD5:!DSS', secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_COMPRESSION | constants.SSL_OP_CIPHER_SERVER_PREFERENCE }, function () { this.write('GET / HTTP/1.1\r\nhost: ' + host + '\r\n\r\n'); });
|
||||||
}
|
}
|
||||||
client.scaninfo = scaninfo;
|
client.scaninfo = scaninfo;
|
||||||
client.func = func;
|
client.func = func;
|
||||||
|
@ -23,7 +23,7 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) {
|
|||||||
obj.ciraConnections = {};
|
obj.ciraConnections = {};
|
||||||
var tlsSessionStore = {}; // Store TLS session information for quick resume.
|
var tlsSessionStore = {}; // Store TLS session information for quick resume.
|
||||||
var tlsSessionStoreCount = 0; // Number of cached TLS session information in store.
|
var tlsSessionStoreCount = 0; // Number of cached TLS session information in store.
|
||||||
const constants = require('constants');
|
const constants = (require('crypto').constants ? require('crypto').constants : require('constants')); // require('constants') is deprecated in Node 11.10, use require('crypto').constants instead.
|
||||||
const common = require("./common.js");
|
const common = require("./common.js");
|
||||||
const net = require("net");
|
const net = require("net");
|
||||||
const tls = require("tls");
|
const tls = require("tls");
|
||||||
|
@ -59,7 +59,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
|||||||
obj.meshRelayHandler = require('./meshrelay.js');
|
obj.meshRelayHandler = require('./meshrelay.js');
|
||||||
obj.meshUserHandler = require('./meshuser.js');
|
obj.meshUserHandler = require('./meshuser.js');
|
||||||
obj.interceptor = require('./interceptor');
|
obj.interceptor = require('./interceptor');
|
||||||
const constants = require('constants');
|
const constants = (obj.crypto.constants ? obj.crypto.constants : require('constants')); // require('constants') is deprecated in Node 11.10, use require('crypto').constants instead.
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
obj.parent = parent;
|
obj.parent = parent;
|
||||||
|
Loading…
Reference in New Issue
Block a user