Skip to content

Commit f44baf6

Browse files
committed
fix imports
1 parent 28a4861 commit f44baf6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

plugins/user-authenticators/ldap/src/main/java/org/apache/cloudstack/ldap/LdapContextFactory.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// under the License.
1717
package org.apache.cloudstack.ldap;
1818

19+
import java.io.FileInputStream;
1920
import java.io.IOException;
2021
import java.util.Hashtable;
2122

@@ -24,6 +25,7 @@
2425
import javax.naming.NamingException;
2526
import javax.naming.ldap.InitialLdapContext;
2627
import javax.naming.ldap.LdapContext;
28+
import java.security.KeyStore;
2729

2830
import org.apache.commons.lang3.StringUtils;
2931
import org.apache.log4j.Logger;
@@ -85,13 +87,17 @@ private void enableSSL(final Hashtable<String, String> environment, Long domainI
8587
}
8688

8789
private boolean validateTrustStore(String trustStore, String trustStorePassword) {
88-
if (trustStore == null || trustStorePassword == null) {
90+
if (trustStore == null) {
91+
return true;
92+
}
93+
94+
if (trustStorePassword == null) {
8995
return false;
9096
}
9197

9298
try {
93-
java.security.KeyStore.getInstance("JKS").load(
94-
new java.io.FileInputStream(trustStore),
99+
KeyStore.getInstance("JKS").load(
100+
new FileInputStream(trustStore),
95101
trustStorePassword.toCharArray()
96102
);
97103
return true;

0 commit comments

Comments
 (0)