From 612f776892bf4a5510993a0ef424cea658707bcc Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Mon, 11 Jul 2011 10:57:32 -0700 Subject: [PATCH] Fix keystore loading path --- utils/src/com/cloud/utils/nio/Link.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/src/com/cloud/utils/nio/Link.java b/utils/src/com/cloud/utils/nio/Link.java index b85da8851ef..2730e289fe1 100755 --- a/utils/src/com/cloud/utils/nio/Link.java +++ b/utils/src/com/cloud/utils/nio/Link.java @@ -43,6 +43,8 @@ import javax.net.ssl.SSLEngineResult.HandshakeStatus; import org.apache.log4j.Logger; +import com.cloud.utils.PropertiesUtil; + /** * Link is the link between the socket listener and the handler threads. */ @@ -352,7 +354,10 @@ public class Link { if (!isClient) { char[] passphrase = "vmops.com".toCharArray(); - String keystorePath = "/etc/cloud/management/cloud.keystore"; + File confFile= PropertiesUtil.findConfigFile("db.properties"); + /* This line may throw a NPE, but that's due to fail to find db.properities, meant some bugs in the other places */ + String confPath = confFile.getParent(); + String keystorePath = confPath + "/cloud.keystore"; if (new File(keystorePath).exists()) { stream = new FileInputStream(keystorePath); } else {