Skip to content

Commit 023aac8

Browse files
committed
CLOUDSTACK-3438: update CPVM SSL certificate for both Premium and non-Premium cases
1 parent a81cc8a commit 023aac8

2 files changed

Lines changed: 10 additions & 15 deletions

File tree

‎client/WEB-INF/web.xml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@
4545
<servlet>
4646
<servlet-name>apiServlet</servlet-name>
4747
<servlet-class>com.cloud.api.ApiServlet</servlet-class>
48+
<load-on-startup>5</load-on-startup>
4849
</servlet>
4950

5051
<servlet>
5152
<servlet-name>consoleServlet</servlet-name>
5253
<servlet-class>com.cloud.servlet.ConsoleProxyServlet</servlet-class>
54+
<load-on-startup>6</load-on-startup>
5355
</servlet>
5456

5557
<servlet>

‎server/src/com/cloud/consoleproxy/AgentHookBase.java‎

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -197,22 +197,15 @@ public AgentControlAnswer onConsoleAccessAuthentication(ConsoleAccessAuthenticat
197197
@Override
198198
public void startAgentHttpHandlerInVM(StartupProxyCommand startupCmd) {
199199
StartConsoleProxyAgentHttpHandlerCommand cmd = null;
200-
if (_configDao.isPremium()) {
201-
String storePassword = String.valueOf(_random.nextLong());
202-
byte[] ksBits =
203-
_ksMgr.getKeystoreBits(ConsoleProxyManager.CERTIFICATE_NAME, ConsoleProxyManager.CERTIFICATE_NAME,
204-
storePassword);
205-
206-
assert (ksBits != null);
207-
if (ksBits == null) {
208-
s_logger.error("Could not find and construct a valid SSL certificate");
209-
}
210-
cmd = new StartConsoleProxyAgentHttpHandlerCommand(ksBits, storePassword);
211-
cmd.setEncryptorPassword(getEncryptorPassword());
212-
} else {
213-
cmd = new StartConsoleProxyAgentHttpHandlerCommand();
214-
cmd.setEncryptorPassword(getEncryptorPassword());
200+
String storePassword = String.valueOf(_random.nextLong());
201+
byte[] ksBits = _ksMgr.getKeystoreBits(ConsoleProxyManager.CERTIFICATE_NAME, ConsoleProxyManager.CERTIFICATE_NAME, storePassword);
202+
203+
assert (ksBits != null);
204+
if (ksBits == null) {
205+
s_logger.error("Could not find and construct a valid SSL certificate");
215206
}
207+
cmd = new StartConsoleProxyAgentHttpHandlerCommand(ksBits, storePassword);
208+
cmd.setEncryptorPassword(getEncryptorPassword());
216209

217210
try {
218211

0 commit comments

Comments
 (0)