consoleproxy: use consoleproxy.domain for non-ssl enable env (#2562)

This allows CloudStack to use a console proxy domain instead of public
IP address even when ssl is not enabled but console proxy url/domain
is defined in global settings.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2018-04-16 18:12:41 +05:30 committed by GitHub
parent 156dbf466c
commit 392f62dae0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -19,6 +19,8 @@
package com.cloud.info;
import org.apache.commons.lang3.StringUtils;
public class ConsoleProxyInfo {
private boolean sslEnabled;
@ -55,6 +57,9 @@ public class ConsoleProxyInfo {
proxyImageUrl += ":" + this.proxyUrlPort;
} else {
proxyAddress = proxyIpAddress;
if (StringUtils.isNotBlank(consoleProxyUrlDomain)) {
proxyAddress = consoleProxyUrlDomain;
}
proxyPort = port;
this.proxyUrlPort = proxyUrlPort;

View File

@ -231,7 +231,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
private String _instance;
private int _proxySessionTimeoutValue = DEFAULT_PROXY_SESSION_TIMEOUT;
private boolean _sslEnabled = true;
private boolean _sslEnabled = false;
private String _consoleProxyUrlDomain;
// global load picture at zone basis
@ -1246,8 +1246,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
Map<String, String> configs = _configDao.getConfiguration("management-server", params);
String value = configs.get(Config.ConsoleProxyCmdPort.key());
value = configs.get("consoleproxy.sslEnabled");
String value = configs.get("consoleproxy.sslEnabled");
if (value != null && value.equalsIgnoreCase("true")) {
_sslEnabled = true;
}