From cb914005c86cee3e4345cae62376713afe5284c1 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Tue, 12 Apr 2016 21:06:33 +0200 Subject: WIP --- .../cmscore/ldapconn/LdapBoundConnFactory.java | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'base/server/cmscore/src/com/netscape/cmscore/ldapconn/LdapBoundConnFactory.java') diff --git a/base/server/cmscore/src/com/netscape/cmscore/ldapconn/LdapBoundConnFactory.java b/base/server/cmscore/src/com/netscape/cmscore/ldapconn/LdapBoundConnFactory.java index 2ac4085c7..07f4ca003 100644 --- a/base/server/cmscore/src/com/netscape/cmscore/ldapconn/LdapBoundConnFactory.java +++ b/base/server/cmscore/src/com/netscape/cmscore/ldapconn/LdapBoundConnFactory.java @@ -17,18 +17,19 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.cmscore.ldapconn; -import netscape.ldap.LDAPConnection; -import netscape.ldap.LDAPException; -import netscape.ldap.LDAPSocketFactory; - import com.netscape.certsrv.apps.CMS; import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.base.IConfigStore; import com.netscape.certsrv.ldap.ELdapException; import com.netscape.certsrv.ldap.ELdapServerDownException; +import com.netscape.certsrv.ldap.ILdapAuthInfo; import com.netscape.certsrv.ldap.ILdapBoundConnFactory; import com.netscape.certsrv.logging.ILogger; +import netscape.ldap.LDAPConnection; +import netscape.ldap.LDAPException; +import netscape.ldap.LDAPSocketFactory; + /** * Factory for getting LDAP Connections to a LDAP server with the same * LDAP authentication. @@ -119,8 +120,14 @@ public class LdapBoundConnFactory implements ILdapBoundConnFactory { throws ELdapException, EBaseException { CMS.debug("LdapBoundConnFactory: init "); - LdapConnInfo connInfo = - new LdapConnInfo(config.getSubStore(PROP_LDAPCONNINFO)); + + LdapConnInfo connInfo = new LdapConnInfo( + config.getSubStore(PROP_LDAPCONNINFO)); + + LdapAuthInfo authInfo = new LdapAuthInfo( + config.getSubStore(PROP_LDAPAUTHINFO), + connInfo.getHost(), connInfo.getPort(), connInfo.getSecure()); + CMS.debug("Auth type: " + (authInfo.getAuthType() == ILdapAuthInfo.LDAP_AUTHTYPE_BASICAUTH ? "basic" : "client cert")); mErrorIfDown = config.getBoolean(PROP_ERROR_IF_DOWN, mDefErrorIfDown); @@ -130,8 +137,7 @@ public class LdapBoundConnFactory implements ILdapBoundConnFactory { init(config.getInteger(PROP_MINCONNS, mMinConns), config.getInteger(PROP_MAXCONNS, mMaxConns), connInfo, - new LdapAuthInfo(config.getSubStore(PROP_LDAPAUTHINFO), - connInfo.getHost(), connInfo.getPort(), connInfo.getSecure())); + authInfo); } /** -- cgit