AMT Manager defaults to TLS on all connection types.

This commit is contained in:
Ylian Saint-Hilaire 2020-10-22 21:46:32 -07:00
parent 56c4346ebe
commit 964857d574
6 changed files with 9 additions and 8 deletions

Binary file not shown.

Binary file not shown.

View File

@ -324,7 +324,8 @@ function CreateAPFClient(parent, args) {
}); });
chan.on('error', function (e) { chan.on('error', function (e) {
Debug("Downlink connection error: " + e); //Debug("Downlink connection error: " + e);
SendChannelOpenFailure(socket.ws, p_res);
}); });
chan.on('end', function () { chan.on('end', function () {

View File

@ -324,7 +324,8 @@ function CreateAPFClient(parent, args) {
}); });
chan.on('error', function (e) { chan.on('error', function (e) {
Debug("Downlink connection error: " + e); //Debug("Downlink connection error: " + e);
SendChannelOpenFailure(socket.ws, p_res);
}); });
chan.on('end', function () { chan.on('end', function () {

View File

@ -426,7 +426,7 @@ var CreateWsmanComm = function (host, port, user, pass, tls, tlsoptions, mpsConn
if (obj.mpsConnection == null) { obj.socket.end(); } else { obj.socket.close(); } if (obj.mpsConnection == null) { obj.socket.end(); } else { obj.socket.close(); }
} else { } else {
var r = obj.pendingAjaxCall.shift(); var r = obj.pendingAjaxCall.shift();
if (r == null || r.length < 1) { console.log("pendingAjaxCall error, " + r); return; } if ((r == null) || (r.length < 1)) { /*console.log("pendingAjaxCall error, " + r);*/ return; } // Get a response without any pending requests.
//if (s != 200) { obj.Debug("Error, status=" + s + "\r\n\r\nreq=" + r[0] + "\r\n\r\nresp=" + data); } // Debug: Display the request & response if something did not work. //if (s != 200) { obj.Debug("Error, status=" + s + "\r\n\r\nreq=" + r[0] + "\r\n\r\nresp=" + data); } // Debug: Display the request & response if something did not work.
obj.authcounter = 0; obj.authcounter = 0;
obj.ActiveAjaxCount--; obj.ActiveAjaxCount--;

View File

@ -418,8 +418,8 @@ module.exports.CreateAmtManager = function (parent) {
dev.amtstack.dev = dev; dev.amtstack.dev = dev;
dev.amtstack.BatchEnum(null, ['*AMT_GeneralSettings', '*IPS_HostBasedSetupService'], attemptLocalConnectResponse); dev.amtstack.BatchEnum(null, ['*AMT_GeneralSettings', '*IPS_HostBasedSetupService'], attemptLocalConnectResponse);
break; break;
case 1: case 1: // CIRA-Relay
case 2: case 2: // CIRA-LMS
// Handle the case where the Intel AMT relay or LMS is connected (connType 1 or 2) // Handle the case where the Intel AMT relay or LMS is connected (connType 1 or 2)
// Check to see if CIRA is connected on this server. // Check to see if CIRA is connected on this server.
var ciraconn = dev.mpsConnection; var ciraconn = dev.mpsConnection;
@ -433,7 +433,6 @@ module.exports.CreateAmtManager = function (parent) {
// Connect now // Connect now
var comm; var comm;
dev.tlsfail = true; // DEBUG!!!!!!!
if (dev.tlsfail !== true) { if (dev.tlsfail !== true) {
parent.debug('amt', 'Relay-Connect', "TLS", dev.name, user, pass); parent.debug('amt', 'Relay-Connect', "TLS", dev.name, user, pass);
comm = CreateWsmanComm(dev.nodeid, 16993, user, pass, 1, null, ciraconn); // Perform TLS comm = CreateWsmanComm(dev.nodeid, 16993, user, pass, 1, null, ciraconn); // Perform TLS
@ -447,7 +446,7 @@ module.exports.CreateAmtManager = function (parent) {
dev.amtstack.dev = dev; dev.amtstack.dev = dev;
dev.amtstack.BatchEnum(null, ['*AMT_GeneralSettings', '*IPS_HostBasedSetupService'], attemptLocalConnectResponse); dev.amtstack.BatchEnum(null, ['*AMT_GeneralSettings', '*IPS_HostBasedSetupService'], attemptLocalConnectResponse);
break; break;
case 3: case 3: // Local LAN
// Handle the case where the Intel AMT local scanner found the device (connType 3) // Handle the case where the Intel AMT local scanner found the device (connType 3)
parent.debug('amt', "Attempt Initial Local Contact", dev.name, dev.connType, dev.host); parent.debug('amt', "Attempt Initial Local Contact", dev.name, dev.connType, dev.host);
if (typeof dev.host != 'string') { removeAmtDevice(dev); return; } // Local connection not valid if (typeof dev.host != 'string') { removeAmtDevice(dev); return; } // Local connection not valid
@ -555,7 +554,7 @@ module.exports.CreateAmtManager = function (parent) {
}); });
} else { } else {
// We got a bad response // We got a bad response
if ((dev.conntype == 1) && (dev.tlsfail !== true) && (status == 408)) { if ((dev.conntype != 0) && (dev.tlsfail !== true) && (status == 408)) { // If not using CIRA and we get a 408 error while using TLS, try non-TLS.
// TLS error on a local connection, try again without TLS // TLS error on a local connection, try again without TLS
dev.tlsfail = true; attemptInitialContact(dev); return; dev.tlsfail = true; attemptInitialContact(dev); return;
} else if (status == 401) { } else if (status == 401) {