ssvm: use secstorage.ssl.cert.domain as hostname if it does not start with '*' when upload a template or volume from local (#3420)

If secstorage.ssl.cert.domain does not start with '*', we should use it as host name in url when upload template/volume from local

Fixes #3305
This commit is contained in:
ustcweizhou 2019-06-26 12:57:07 +02:00 committed by Rohit Yadav
parent e76266e39b
commit 2408783355

View File

@ -30,9 +30,11 @@ public class ImageStoreUtil {
//if ssvm url domain is present, use it to construct hostname in the format 1-2-3-4.domain
// if the domain name is not present, ssl validation fails and has to be ignored
if(StringUtils.isNotBlank(ssvmUrlDomain)) {
if(StringUtils.isNotBlank(ssvmUrlDomain) && ssvmUrlDomain.startsWith("*")) {
hostname = ipAddress.replace(".", "-");
hostname = hostname + ssvmUrlDomain.substring(1);
} else if (StringUtils.isNotBlank(ssvmUrlDomain)) {
hostname = ssvmUrlDomain;
}
//only https works with postupload and url format is fixed