From 9e5e3cf73d500618c943273c0ffc558585636d51 Mon Sep 17 00:00:00 2001 From: prabathabey Date: Thu, 23 Jul 2015 09:57:50 +0530 Subject: [PATCH] Enforcing proxy port to be used when configured --- .../mgt/core/startup/handler/URLPrinterStartupHandler.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/startup/handler/URLPrinterStartupHandler.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/startup/handler/URLPrinterStartupHandler.java index 17a5b0dc17..83250c0d22 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/startup/handler/URLPrinterStartupHandler.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/startup/handler/URLPrinterStartupHandler.java @@ -51,11 +51,14 @@ public class URLPrinterStartupHandler implements ServerStartupObserver { String mgtConsoleTransport = CarbonUtils.getManagementTransport(); ConfigurationContextService configContextService = DeviceManagementDataHolder.getInstance().getConfigurationContextService(); - int httpsPort = CarbonUtils.getTransportPort(configContextService, mgtConsoleTransport); + int port = CarbonUtils.getTransportPort(configContextService, mgtConsoleTransport); int httpsProxyPort = CarbonUtils.getTransportProxyPort(configContextService.getServerConfigContext(), mgtConsoleTransport); - return "https://" + hostName + ":" + httpsPort + "/mdm"; + if (httpsProxyPort > 0) { + port = httpsProxyPort; + } + return "https://" + hostName + ":" + port + "/mdm"; } }