cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weiz...@apache.org
Subject [1/4] git commit: updated refs/heads/4.1 to 3b5bcac
Date Fri, 12 Jul 2013 09:35:49 GMT
Updated Branches:
  refs/heads/4.1 e4d96bd7b -> 3b5bcac81


CLOUDSTACK-2940
Allowing Replacement of realhostip.com with a customized domain for SSVM. Though the config
variable was there we were always hardcoding to realhostip.com
Reviewed-by: Abhi


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5174b002
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5174b002
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5174b002

Branch: refs/heads/4.1
Commit: 5174b002bc3e2e0013a580e63bf3ac45c18e5e2a
Parents: e4d96bd
Author: Nitin Mehta <nitin.mehta@citrix.com>
Authored: Thu Oct 11 19:38:32 2012 +0530
Committer: Wei Zhou <w.zhou@leaseweb.com>
Committed: Fri Jul 12 11:01:33 2013 +0200

----------------------------------------------------------------------
 .../storage/download/DownloadMonitorImpl.java   | 20 ++++++++++++--------
 .../cloud/storage/upload/UploadMonitorImpl.java | 14 +++++++++-----
 2 files changed, 21 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5174b002/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/download/DownloadMonitorImpl.java b/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
index 6f6c9ef..fe0ad8d 100755
--- a/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
+++ b/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
@@ -159,6 +159,7 @@ public class DownloadMonitorImpl extends ManagerBase implements  DownloadMonitor
     protected ResourceLimitService _resourceLimitMgr;
 
 	private Boolean _sslCopy = new Boolean(false);
+	String _ssvmUrlDomain;
 	private String _copyAuthPasswd;
 	private String _proxy = null;
     protected SearchBuilder<VMTemplateHostVO> ReadyTemplateStatesSearch;
@@ -179,11 +180,8 @@ public class DownloadMonitorImpl extends ManagerBase implements  DownloadMonitor
         _sslCopy = Boolean.parseBoolean(configs.get("secstorage.encrypt.copy"));
         _proxy = configs.get(Config.SecStorageProxy.key());
         
-        String cert = configs.get("secstorage.ssl.cert.domain");
-        if (!"realhostip.com".equalsIgnoreCase(cert)) {
-        	s_logger.warn("Only realhostip.com ssl cert is supported, ignoring self-signed and
other certs");
-        }
-        
+        _ssvmUrlDomain = configs.get("secstorage.ssl.cert.domain");
+       
         _copyAuthPasswd = configs.get("secstorage.copy.password");
         
         _agentMgr.registerForHostEvents(new DownloadListener(this), true, false, false);
@@ -299,9 +297,15 @@ public class DownloadMonitorImpl extends ManagerBase implements  DownloadMonitor
 		String hostname = ipAddress;
 		String scheme = "http";
 		if (_sslCopy) {
-			hostname = ipAddress.replace(".", "-");
-			hostname = hostname + ".realhostip.com";
-			scheme = "https";
+            hostname = ipAddress.replace(".", "-");
+            scheme = "https";
+            
+            // Code for putting in custom certificates.
+            if(_ssvmUrlDomain != null && _ssvmUrlDomain.length() > 0){
+                hostname = hostname + "." + _ssvmUrlDomain;
+            }else{
+                hostname = hostname + ".realhostip.com";
+            }	
 		}
 		return scheme + "://" + hostname + "/copy/SecStorage/" + dir + "/" + path; 
 	}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5174b002/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/upload/UploadMonitorImpl.java b/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
index 77f0d20..31f3e74 100755
--- a/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
+++ b/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
@@ -106,6 +106,7 @@ public class UploadMonitorImpl extends ManagerBase implements UploadMonitor
{
 
 	private String _name;
 	private Boolean _sslCopy = new Boolean(false);
+	private String _ssvmUrlDomain;
     private ScheduledExecutorService _executor = null;
 
 	Timer _timer;
@@ -329,8 +330,14 @@ public class UploadMonitorImpl extends ManagerBase implements UploadMonitor
{
 	        String scheme = "http";
 	        if (_sslCopy) {
 	            hostname = ipAddress.replace(".", "-");
-	            hostname = hostname + ".realhostip.com";
 	            scheme = "https";
+	            
+	            // Code for putting in custom certificates.
+	            if(_ssvmUrlDomain != null && _ssvmUrlDomain.length() > 0){
+	            	hostname = hostname + "." + _ssvmUrlDomain;
+	            }else{
+	            	hostname = hostname + ".realhostip.com";
+	            }	            
 	        }
 	        return scheme + "://" + hostname + "/userdata/" + uuid; 
 	    }
@@ -347,10 +354,7 @@ public class UploadMonitorImpl extends ManagerBase implements UploadMonitor
{
         final Map<String, String> configs = _configDao.getConfiguration("ManagementServer",
params);
         _sslCopy = Boolean.parseBoolean(configs.get("secstorage.encrypt.copy"));
         
-        String cert = configs.get("secstorage.secure.copy.cert");
-        if ("realhostip.com".equalsIgnoreCase(cert)) {
-        	s_logger.warn("Only realhostip.com ssl cert is supported, ignoring self-signed and
other certs");
-        }        
+        _ssvmUrlDomain = configs.get("secstorage.ssl.cert.domain");      
         
         _agentMgr.registerForHostEvents(new UploadListener(this), true, false, false);
         String cleanupInterval = configs.get("extract.url.cleanup.interval");


Mime
View raw message