CLOUDSTACK-2940: Allowing Replacement of realhostip.com with a customized domain for SSVM

(cherry picked from commit e23b10319f)
This commit is contained in:
Wei Zhou 2013-11-26 14:10:51 +01:00
parent 3deb7dd6f5
commit 895e581e73
3 changed files with 8 additions and 3 deletions

View File

@ -88,12 +88,17 @@ public class CloudStackImageStoreDriverImpl extends BaseImageStoreDriverImpl {
String scheme = "http";
boolean _sslCopy = false;
String sslCfg = _configDao.getValue(Config.SecStorageEncryptCopy.toString());
String _ssvmUrlDomain = _configDao.getValue("secstorage.ssl.cert.domain");
if ( sslCfg != null ){
_sslCopy = Boolean.parseBoolean(sslCfg);
}
if (_sslCopy) {
hostname = ipAddress.replace(".", "-");
hostname = hostname + ".realhostip.com";
if(_ssvmUrlDomain != null && _ssvmUrlDomain.length() > 0){
hostname = hostname + "." + _ssvmUrlDomain;
} else {
hostname = hostname + ".realhostip.com";
}
scheme = "https";
}
return scheme + "://" + hostname + "/userdata/" + uuid;

View File

@ -106,7 +106,7 @@ public class DownloadMonitorImpl extends ManagerBase implements DownloadMonitor
@Override
public boolean configure(String name, Map<String, Object> params) {
final Map<String, String> configs = _configDao.getConfiguration("ManagementServer", params);
final Map<String, String> configs = _configDao.getConfiguration("management-server", params);
_sslCopy = Boolean.parseBoolean(configs.get("secstorage.encrypt.copy"));
_proxy = configs.get(Config.SecStorageProxy.key());

View File

@ -385,7 +385,7 @@ public class UploadMonitorImpl extends ManagerBase implements UploadMonitor {
@Override
public boolean configure(String name, Map<String, Object> params)
throws ConfigurationException {
final Map<String, String> configs = _configDao.getConfiguration("ManagementServer", params);
final Map<String, String> configs = _configDao.getConfiguration("management-server", params);
_sslCopy = Boolean.parseBoolean(configs.get("secstorage.encrypt.copy"));
String cert = configs.get("secstorage.secure.copy.cert");