This commit is contained in:
Ylian Saint-Hilaire 2021-04-11 22:44:43 -07:00
parent 775457e2b9
commit 112298cf84
2 changed files with 7 additions and 2 deletions

View File

@ -471,7 +471,12 @@ var CreateWsmanComm = function (host, port, user, pass, tls, tlsoptions, mpsConn
obj.destroy = function () {
if (obj.socket != null) {
if (obj.socket.removeAllListeners) { obj.socket.removeAllListeners(); }
if (obj.socket.removeAllListeners) {
// Do not remove the error handler since it may still get triggered.
obj.socket.removeAllListeners('data');
obj.socket.removeAllListeners('close');
obj.socket.removeAllListeners('timeout');
}
try {
if (obj.mpsConnection == null) {
obj.socket.destroy();

View File

@ -42,7 +42,7 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) {
if (obj.args.mpstlsoffload) {
obj.server = net.createServer(onConnection);
} else {
// Note that in oder to support older Intel AMT CIRA connections, we have to turn on TLSv1.
// Note that in order to support older Intel AMT CIRA connections, we have to turn on TLSv1.
obj.server = tls.createServer({ key: certificates.mps.key, cert: certificates.mps.cert, minVersion: 'TLSv1', requestCert: true, rejectUnauthorized: false, ciphers: "HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA", secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_COMPRESSION }, onConnection);
//obj.server.on('error', function () { console.log('MPS tls server error'); });
obj.server.on('newSession', function (id, data, cb) { if (tlsSessionStoreCount > 1000) { tlsSessionStoreCount = 0; tlsSessionStore = {}; } tlsSessionStore[id.toString('hex')] = data; tlsSessionStoreCount++; cb(); });