Fix keystore loading path

This commit is contained in:
Sheng Yang 2011-07-11 10:57:32 -07:00
parent 98b728bf70
commit 612f776892

View File

@ -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 {