You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by sm...@apache.org on 2014/11/04 19:07:16 UTC
git commit: FC-39 - Cleanup NPE during ldap pool init
Repository: directory-fortress-core
Updated Branches:
refs/heads/master 804ca390f -> c464c7305
FC-39 - Cleanup NPE during ldap pool init
Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/commit/c464c730
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/c464c730
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/c464c730
Branch: refs/heads/master
Commit: c464c730546a75ad8da2ba8c2bfe84b4c1b6a90f
Parents: 804ca39
Author: Shawn McKinney <sm...@apache.org>
Authored: Tue Nov 4 12:06:58 2014 -0600
Committer: Shawn McKinney <sm...@apache.org>
Committed: Tue Nov 4 12:06:58 2014 -0600
----------------------------------------------------------------------
.../core/ldap/ApacheDsDataProvider.java | 23 +++++++++++---------
1 file changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/c464c730/src/main/java/org/apache/directory/fortress/core/ldap/ApacheDsDataProvider.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ldap/ApacheDsDataProvider.java b/src/main/java/org/apache/directory/fortress/core/ldap/ApacheDsDataProvider.java
index 15cf330..6aca198 100644
--- a/src/main/java/org/apache/directory/fortress/core/ldap/ApacheDsDataProvider.java
+++ b/src/main/java/org/apache/directory/fortress/core/ldap/ApacheDsDataProvider.java
@@ -78,8 +78,8 @@ import org.slf4j.LoggerFactory;
/**
* Abstract class contains methods to perform low-level entity to ldap persistence. These methods are called by the
- * Fortress DAO's, i.e. {@link org.apache.directory.fortress.core.rbac.UserDAO}. {@link org.apache.directory.fortress.core.rbac.dao.apache
- * .RoleDAO}, {@link org.apache.directory.fortress.core.rbac.PermDAO}, ....
+ * Fortress DAO's, i.e. {@link org.apache.directory.fortress.core.rbac.UserDAO}. {@link org.apache.directory.fortress.core.rbac.RoleDAO},
+ * {@link org.apache.directory.fortress.core.rbac.PermDAO}, ....
* These are low-level data utilities, very little if any data validations are performed here.
* <p/>
* This class is thread safe.
@@ -170,10 +170,11 @@ public abstract class ApacheDsDataProvider
config.setUseSsl( IS_SSL );
//config.setTrustManagers( new NoVerificationTrustManager() );
- // validate certificates but allow self-signed certs if within this truststore:
- config.setTrustManagers( new LdapClientTrustStoreManager(
- TRUST_STORE,
- TRUST_STORE_PW.toCharArray() , null, true ) );
+ if(IS_SSL && VUtil.isNotNullOrEmpty( TRUST_STORE ) && VUtil.isNotNullOrEmpty( TRUST_STORE_PW ) )
+ {
+ // validate certificates but allow self-signed certs if within this truststore:
+ config.setTrustManagers( new LdapClientTrustStoreManager( TRUST_STORE, TRUST_STORE_PW.toCharArray(), null, true ) );
+ }
String adminPw;
if ( EncryptUtil.isEnabled() )
@@ -238,10 +239,12 @@ public abstract class ApacheDsDataProvider
logConfig.setName( Config.getProperty( LDAP_ADMIN_POOL_UID, "" ) );
logConfig.setUseSsl( IS_SSL );
- // validate certificates but allow self-signed certs if within this truststore:
- logConfig.setTrustManagers( new LdapClientTrustStoreManager(
- TRUST_STORE,
- TRUST_STORE_PW.toCharArray() , null, true ) );
+
+ if( IS_SSL && VUtil.isNotNullOrEmpty( TRUST_STORE ) && VUtil.isNotNullOrEmpty( TRUST_STORE_PW ) )
+ {
+ // validate certificates but allow self-signed certs if within this truststore:
+ logConfig.setTrustManagers( new LdapClientTrustStoreManager( TRUST_STORE, TRUST_STORE_PW.toCharArray(), null, true ) );
+ }
logConfig.setName( Config.getProperty( LDAP_LOG_POOL_UID, "" ) );
String logPw;