You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: framework/security/src/main/java/org/apache/cloudstack/framework/security/keystore/KeystoreManagerImpl.java
+14-9Lines changed: 14 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,7 @@
30
30
31
31
importjavax.inject.Inject;
32
32
33
+
importcom.cloud.utils.Pair;
33
34
importorg.apache.commons.lang3.StringUtils;
34
35
importorg.apache.log4j.Logger;
35
36
importorg.springframework.stereotype.Component;
@@ -47,24 +48,28 @@ public class KeystoreManagerImpl extends ManagerBase implements KeystoreManager
Pair<Boolean, String> result = _ksMgr.validateCertificate(certificate, key, domainSuffix);
4514
+
if (!result.first()) {
4515
+
thrownewInvalidParameterValueException(String.format("Failed to pass certificate validation check with error: %s", result.second()));
4516
+
}
4517
+
} else {
4518
+
try {
4519
+
s_logger.debug(String.format("Trying to validate the root certificate format"));
4520
+
CertificateHelper.buildCertificate(certificate);
4521
+
} catch (CertificateExceptione) {
4522
+
StringerrorMsg = String.format("Failed to pass certificate validation check with error: Certificate validation failed due to exception: %s", e.getMessage());
0 commit comments