Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to trace eureka registration #591

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This repo is part of the app-server Zowe Component, and the change logs here may
## 2.18.1
- Bugfix: App-server could not register with discovery server when AT-TLS was enabled for app-server. (#581)
- Bugfix: App-server /server/environment endpoint was missing the "agent" object, causing the Desktop to choose an indirect route to accessing ZSS. This fix improves latency and high availability behavior of ZSS APIs in the Desktop. (#589)
- Bugfix: When eureka registration experienced a network failure, troubleshooting information was not available. The property `components.app-server.node.mediationLayer.traceTls` now exists for troubleshooting TLS issues. (#591)

## 2.17.0
- Enhancement: Added function `isClientAttls(zoweConfig)` within `libs/util.js`. Whenever a plugin makes a network request, it should always use this to determine if a normally HTTPS request should instead be made as HTTP due to AT-TLS handling the TLS when enabled. (#544)
Expand Down
10 changes: 7 additions & 3 deletions lib/apiml.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ const MEDIATION_LAYER_INSTANCE_DEFAULTS = (zluxProto, zluxHostname, zluxPort) =>
}};

function ApimlConnector({ hostName, port, discoveryUrls,
discoveryPort, tlsOptions, eurekaOverrides, isClientAttls }) {
discoveryPort, tlsOptions, eurekaOverrides, isClientAttls, traceTls }) {
Object.assign(this, { hostName, port, discoveryUrls,
discoveryPort, tlsOptions, eurekaOverrides, isClientAttls });
discoveryPort, tlsOptions, eurekaOverrides, isClientAttls, traceTls });
//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'];
const clientGatewayAttls = process.env['ZWE_components_gateway_zowe_network_client_tls_attls'];
Expand Down Expand Up @@ -246,7 +246,11 @@ ApimlConnector.prototype = {
},*/

registerMainServerInstance() {
const overrideOptions = this.isClientAttls ? {} : Object.assign({},this.tlsOptions)
const overrideOptions = this.isClientAttls
? {}
//Use server's own TLS options except for TLS tracing.
: Object.assign(Object.assign({},this.tlsOptions), {enableTrace: this.traceTls ? true : false});

if (!this.tlsOptions.rejectUnauthorized) {
//Keeping these certs causes an openssl error 46, unknown cert error in a dev environment
delete overrideOptions.cert;
Expand Down
1 change: 1 addition & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ Server.prototype = {
port: this.port,
discoveryUrls: apimlConfig.server.discoveryUrls || [`https://${apimlConfig.server.hostname}:${apimlConfig.server.port}/eureka/`],
tlsOptions: this.tlsOptions,
traceTls: apimlConfig.traceTls,
eurekaOverrides: apimlConfig.eureka,
isClientAttls: util.isClientAttls(this.zoweConfig)
});
Expand Down
Loading