mirror of https://github.com/apache/cloudstack.git
server: add global setting consoleproxy.sslEnabled (#8809)
This commit is contained in:
parent
674495b162
commit
313a165e62
|
|
@ -118,7 +118,7 @@ public class AgentBasedConsoleProxyManager extends ManagerBase implements Consol
|
|||
_consoleProxyPort = NumbersUtil.parseInt(value, ConsoleProxyManager.DEFAULT_PROXY_VNC_PORT);
|
||||
}
|
||||
|
||||
value = configs.get("consoleproxy.sslEnabled");
|
||||
value = configs.get(ConsoleProxySslEnabled.key());
|
||||
if (value != null && value.equalsIgnoreCase("true")) {
|
||||
_sslEnabled = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ public abstract class AgentHookBase implements AgentHook {
|
|||
byte[] ksBits = null;
|
||||
|
||||
String consoleProxyUrlDomain = _configDao.getValue(Config.ConsoleProxyUrlDomain.key());
|
||||
String consoleProxySslEnabled = _configDao.getValue("consoleproxy.sslEnabled");
|
||||
String consoleProxySslEnabled = _configDao.getValue(ConsoleProxyManager.ConsoleProxySslEnabled.key());
|
||||
if (!StringUtils.isEmpty(consoleProxyUrlDomain) && !StringUtils.isEmpty(consoleProxySslEnabled)
|
||||
&& consoleProxySslEnabled.equalsIgnoreCase("true")) {
|
||||
ksBits = _ksMgr.getKeystoreBits(ConsoleProxyManager.CERTIFICATE_NAME, ConsoleProxyManager.CERTIFICATE_NAME, storePassword);
|
||||
|
|
|
|||
|
|
@ -36,6 +36,9 @@ public interface ConsoleProxyManager extends Manager, ConsoleProxyService {
|
|||
String ALERT_SUBJECT = "proxy-alert";
|
||||
String CERTIFICATE_NAME = "CPVMCertificate";
|
||||
|
||||
ConfigKey<Boolean> ConsoleProxySslEnabled = new ConfigKey<>(ConfigKey.CATEGORY_ADVANCED, Boolean.class, "consoleproxy.sslEnabled", "false",
|
||||
"Enable SSL for console proxy", false);
|
||||
|
||||
ConfigKey<Boolean> NoVncConsoleDefault = new ConfigKey<>(ConfigKey.CATEGORY_ADVANCED, Boolean.class, "novnc.console.default", "true",
|
||||
"If true, noVNC console will be default console for virtual machines", true);
|
||||
|
||||
|
|
|
|||
|
|
@ -1120,7 +1120,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
|
|||
|
||||
Map<String, String> configs = configurationDao.getConfiguration("management-server", params);
|
||||
|
||||
String value = configs.get("consoleproxy.sslEnabled");
|
||||
String value = configs.get(ConsoleProxySslEnabled.key());
|
||||
if (value != null && value.equalsIgnoreCase("true")) {
|
||||
sslEnabled = true;
|
||||
}
|
||||
|
|
@ -1609,7 +1609,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
|
|||
|
||||
@Override
|
||||
public ConfigKey<?>[] getConfigKeys() {
|
||||
return new ConfigKey<?>[] { NoVncConsoleDefault, NoVncConsoleSourceIpCheckEnabled };
|
||||
return new ConfigKey<?>[] { ConsoleProxySslEnabled, NoVncConsoleDefault, NoVncConsoleSourceIpCheckEnabled };
|
||||
}
|
||||
|
||||
protected ConsoleProxyStatus parseJsonToConsoleProxyStatus(String json) throws JsonParseException {
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public class StaticConsoleProxyManager extends AgentBasedConsoleProxyManager imp
|
|||
_ip = "127.0.0.1";
|
||||
}
|
||||
|
||||
String value = (String)params.get("consoleproxy.sslEnabled");
|
||||
String value = (String)params.get(ConsoleProxySslEnabled.key());
|
||||
if (value != null && value.equalsIgnoreCase("true")) {
|
||||
_sslEnabled = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue