Skip to content

Commit

Permalink
Fix logic about client attls of gateway
Browse files Browse the repository at this point in the history
Signed-off-by: 1000TurquoisePogs <[email protected]>
  • Loading branch information
1000TurquoisePogs authored Jan 13, 2025
1 parent 45a8953 commit 84d57a3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/apiml.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ function ApimlConnector({ hostName, port, discoveryUrls,
Object.assign(this, { hostName, port, discoveryUrls,
discoveryPort, tlsOptions, eurekaOverrides, isClientAttls });
//TODO config should never be checked through env var, but is temporarily needed to temporarily read gateway's ATTLS state to provide it with Eureka info it can work with.
const clientGlobalAttls = process.env['ZWE_zowe_network_client_tls_attls'] == 'true';
const clientGatewayAttls = process.env['ZWE_components_gateway_zowe_network_client_tls_attls'] == 'true';
const clientAttls = clientGlobalAttls || clientGatewayAttls;
const clientGlobalAttls = process.env['ZWE_zowe_network_client_tls_attls'];
const clientGatewayAttls = process.env['ZWE_components_gateway_zowe_network_client_tls_attls'];
const clientAttls = (clientGlobalAttls == 'true') || (clientGatewayAttls == 'true');
this.isGatewayClientAttls = false;
if ((clientGlobalAttls !== false) && (clientLocalAttls !== false) && (!clientAttls)) {
// If client attls not explicitly false OR truthy, have client follow server attls variable. it simplifies common case in which users want both.
if ((clientGlobalAttls === undefined) && (clientGatewayAttls === undefined)) {
// If client attls env vars are not set, have client follow server attls variable. it simplifies common case in which users want both.
const serverGlobalAttls = process.env['ZWE_zowe_network_server_tls_attls'] == 'true';
const serverGatewayAttls = process.env['ZWE_components_gateway_zowe_network_server_tls_attls'] == 'true';
this.isGatewayClientAttls = serverGlobalAttls || serverGatewayAttls;
Expand Down

0 comments on commit 84d57a3

Please sign in to comment.