Skip to content

Commit 895e581

Browse files
committed
CLOUDSTACK-2940: Allowing Replacement of realhostip.com with a customized domain for SSVM
(cherry picked from commit e23b103)
1 parent 3deb7dd commit 895e581

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackImageStoreDriverImpl.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,17 @@ private String generateCopyUrl(String ipAddress, String uuid){
8888
String scheme = "http";
8989
boolean _sslCopy = false;
9090
String sslCfg = _configDao.getValue(Config.SecStorageEncryptCopy.toString());
91+
String _ssvmUrlDomain = _configDao.getValue("secstorage.ssl.cert.domain");
9192
if ( sslCfg != null ){
9293
_sslCopy = Boolean.parseBoolean(sslCfg);
9394
}
9495
if (_sslCopy) {
9596
hostname = ipAddress.replace(".", "-");
96-
hostname = hostname + ".realhostip.com";
97+
if(_ssvmUrlDomain != null && _ssvmUrlDomain.length() > 0){
98+
hostname = hostname + "." + _ssvmUrlDomain;
99+
} else {
100+
hostname = hostname + ".realhostip.com";
101+
}
97102
scheme = "https";
98103
}
99104
return scheme + "://" + hostname + "/userdata/" + uuid;

‎server/src/com/cloud/storage/download/DownloadMonitorImpl.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public class DownloadMonitorImpl extends ManagerBase implements DownloadMonitor
106106

107107
@Override
108108
public boolean configure(String name, Map<String, Object> params) {
109-
final Map<String, String> configs = _configDao.getConfiguration("ManagementServer", params);
109+
final Map<String, String> configs = _configDao.getConfiguration("management-server", params);
110110
_sslCopy = Boolean.parseBoolean(configs.get("secstorage.encrypt.copy"));
111111
_proxy = configs.get(Config.SecStorageProxy.key());
112112

‎server/src/com/cloud/storage/upload/UploadMonitorImpl.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ private String generateCopyUrl(String ipAddress, String uuid){
385385
@Override
386386
public boolean configure(String name, Map<String, Object> params)
387387
throws ConfigurationException {
388-
final Map<String, String> configs = _configDao.getConfiguration("ManagementServer", params);
388+
final Map<String, String> configs = _configDao.getConfiguration("management-server", params);
389389
_sslCopy = Boolean.parseBoolean(configs.get("secstorage.encrypt.copy"));
390390

391391
String cert = configs.get("secstorage.secure.copy.cert");

0 commit comments

Comments
 (0)