From 8ed09ef74d6ba2e47b659760c32e47ca661be915 Mon Sep 17 00:00:00 2001 From: Miguel <8298055+mikeV02@users.noreply.github.com> Date: Thu, 3 Feb 2022 21:26:34 -0500 Subject: [PATCH 1/3] Correcting use of httpsPort instead of secure.port I was trying to change the TrafficRouter SecurePort value to other than 443, and tried to use the parameter secure.port added to the server.xml on the CCR profile in Traffic Portal. But noticed, that TcOps/TcMon, do not add that parameter to the CrCronfig.json.I digged into the code and fount that the use of secure.port was added to TrafficRouter on the following commit: https://github.com/apache/trafficcontrol/commit/8ff9006beb0639a21ac3235cdeaa15bf852cfc1a However, no counter part was added to TcOps to actually state the value secure.port from the TrafficPortal paramenters. The value that TcOps adds to the CrConfig.json is the httpsPort, from the server configuration itself on TrafficPortal, but that parameter is not used anyowhere by Traffic Router (from what I saw).I see that it would require just two lines edits on traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/util/LanguidState.java to make use of httpsPort and not the unexisting secure.port.Basically, edit lines 86 and 87 of the file, and replace secure.port for httpsPort --- .../traffic_router/core/util/LanguidState.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/util/LanguidState.java b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/util/LanguidState.java index eb668136dd..ef0ebf8a36 100644 --- a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/util/LanguidState.java +++ b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/util/LanguidState.java @@ -83,8 +83,8 @@ private void initPorts(final JsonNode routerJson) { trafficRouterManager.setApiPort(apiPort); } - if (routerJson.has("secure.port")) { - setSecurePort(routerJson.get("secure.port").asInt()); + if (routerJson.has("httpsPort")) { + setSecurePort(routerJson.get("httpsPort").asInt()); } if (routerJson.has("secure.api.port")) { From af758300759ca1b56af990cb15732d6800368536 Mon Sep 17 00:00:00 2001 From: Miguel <8298055+mikeV02@users.noreply.github.com> Date: Thu, 3 Feb 2022 21:40:16 -0500 Subject: [PATCH 2/3] Correcting use of httpsPort instead of secure.port --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 729c8d7f9b..2b85a2d45e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Fixed - Update traffic_portal dependencies to mitigate `npm audit` issues. - Fixed a cdn-in-a-box build issue when using `RHEL_VERSION=7` +- Fixed the incorrect use of secure.port on TrafficRouter and corrected to the httpsPort value from the TR server configuration. ### Removed - Remove traffic_portal dependencies to mitigate `npm audit` issues, specifically `grunt-concurrent`, `grunt-contrib-concat`, `grunt-contrib-cssmin`, `grunt-contrib-jsmin`, `grunt-contrib-uglify`, `grunt-contrib-htmlmin`, `grunt-newer`, and `grunt-wiredep` From cc82abce28bbba2c04620dede26dea7b139ed3c2 Mon Sep 17 00:00:00 2001 From: Miguel <8298055+mikeV02@users.noreply.github.com> Date: Mon, 7 Feb 2022 21:05:35 -0500 Subject: [PATCH 3/3] correcting to use hasNonNull instead of has --- .../traffic_control/traffic_router/core/util/LanguidState.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/util/LanguidState.java b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/util/LanguidState.java index ef0ebf8a36..d84bb03636 100644 --- a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/util/LanguidState.java +++ b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/util/LanguidState.java @@ -83,7 +83,7 @@ private void initPorts(final JsonNode routerJson) { trafficRouterManager.setApiPort(apiPort); } - if (routerJson.has("httpsPort")) { + if (routerJson.hasNonNull("httpsPort")) { setSecurePort(routerJson.get("httpsPort").asInt()); }