From 77c88fa917917fde2a4533ffdf7b6219cc79f081 Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Mon, 1 Dec 2014 18:52:15 -0800 Subject: [PATCH] CLOUDSTACK-7999: Always override local keystore file with the entry in DB --- server/src/com/cloud/server/ConfigurationServerImpl.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java b/server/src/com/cloud/server/ConfigurationServerImpl.java index 7b0d8985597..306c0e7bf0f 100644 --- a/server/src/com/cloud/server/ConfigurationServerImpl.java +++ b/server/src/com/cloud/server/ConfigurationServerImpl.java @@ -638,13 +638,6 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio "SSL Keystore for the management servers"); _configDao.persist(configVO); s_logger.info("Stored SSL keystore to database."); - } else if (null != keystoreFile && keystoreFile.exists()) { // and dbExisted - // Check if they are the same one, otherwise override with local keystore - String base64Keystore = getBase64Keystore(keystorePath); - if (base64Keystore.compareTo(dbString) != 0) { - _configDao.update("ssl.keystore", "Hidden", base64Keystore); - s_logger.info("Updated database keystore with local one."); - } } else { // !keystoreFile.exists() and dbExisted // Export keystore to local file byte[] storeBytes = Base64.decodeBase64(dbString); @@ -654,6 +647,7 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio fo.write(storeBytes); fo.close(); Script script = new Script(true, "cp", 5000, null); + script.add("-f"); script.add(tmpKeystorePath); //There is a chance, although small, that the keystorePath is null. In that case, do not add it to the script.