diff --git a/nuxeo-services/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPFilterMatcher.java b/nuxeo-services/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPFilterMatcher.java
index edbc3d03eaa..bc567d330e1 100644
--- a/nuxeo-services/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPFilterMatcher.java
+++ b/nuxeo-services/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPFilterMatcher.java
@@ -20,7 +20,6 @@
 
 package org.nuxeo.ecm.directory.ldap;
 
-import java.io.IOException;
 import java.text.ParseException;
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
@@ -30,15 +29,17 @@ import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 
-import org.apache.directory.shared.ldap.filter.BranchNode;
-import org.apache.directory.shared.ldap.filter.ExprNode;
-import org.apache.directory.shared.ldap.filter.FilterParser;
-import org.apache.directory.shared.ldap.filter.FilterParserImpl;
-import org.apache.directory.shared.ldap.filter.PresenceNode;
-import org.apache.directory.shared.ldap.filter.SimpleNode;
-import org.apache.directory.shared.ldap.filter.SubstringNode;
-import org.apache.directory.shared.ldap.name.DefaultStringNormalizer;
-import org.apache.directory.shared.ldap.schema.Normalizer;
+import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.ldap.model.filter.AndNode;
+import org.apache.directory.shared.ldap.model.filter.BranchNode;
+import org.apache.directory.shared.ldap.model.filter.ExprNode;
+import org.apache.directory.shared.ldap.model.filter.FilterParser;
+import org.apache.directory.shared.ldap.model.filter.NotNode;
+import org.apache.directory.shared.ldap.model.filter.OrNode;
+import org.apache.directory.shared.ldap.model.filter.PresenceNode;
+import org.apache.directory.shared.ldap.model.filter.SimpleNode;
+import org.apache.directory.shared.ldap.model.filter.SubstringNode;
+import org.apache.directory.shared.ldap.model.schema.normalizers.DefaultStringNormalizer;
 import org.nuxeo.ecm.directory.DirectoryException;
 
 /**
@@ -51,13 +52,7 @@ import org.nuxeo.ecm.directory.DirectoryException;
  */
 public class LDAPFilterMatcher {
 
-    private final FilterParser parser;
-
-    // lazily initialized normalizer for the substring match
-    private Normalizer normalizer;
-
     LDAPFilterMatcher() {
-        parser = new FilterParserImpl();
     }
 
     /**
@@ -72,9 +67,9 @@ public class LDAPFilterMatcher {
             return true;
         }
         try {
-            ExprNode parsedFilter = parser.parse(filter);
+            ExprNode parsedFilter = FilterParser.parse(filter);
             return recursiveMatch(attributes, parsedFilter);
-        } catch (DirectoryException | IOException | ParseException e) {
+        } catch (DirectoryException | ParseException e) {
             throw new DirectoryException("could not parse LDAP filter: " + filter, e);
         }
     }
@@ -105,7 +100,7 @@ public class LDAPFilterMatcher {
      *
      * @return true if the equality holds
      */
-    protected static boolean simpleMatch(Attributes attributes, SimpleNode simpleElement) {
+    protected static boolean simpleMatch(Attributes attributes, SimpleNode<String> simpleElement) {
         Attribute attribute = attributes.get(simpleElement.getAttribute());
         if (attribute == null) {
             // null attribute cannot match any equality statement
@@ -117,12 +112,12 @@ public class LDAPFilterMatcher {
             try {
                 while (rawValues.hasMore()) {
                     String rawValue = rawValues.next().toString();
-                    if (isCaseSensitive || !(simpleElement.getValue() instanceof String)) {
+                    if (isCaseSensitive || !(simpleElement.getValue().getString() instanceof String)) {
                         if (simpleElement.getValue().equals(rawValue)) {
                             return true;
                         }
                     } else {
-                        String stringElementValue = (String) simpleElement.getValue();
+                        String stringElementValue = simpleElement.getValue().getString();
                         if (stringElementValue.equalsIgnoreCase(rawValue)) {
                             return true;
                         }
@@ -171,22 +166,21 @@ public class LDAPFilterMatcher {
             try {
                 while (rawValues.hasMore()) {
                     String rawValue = rawValues.next().toString();
-                    getNormalizer();
                     StringBuffer sb = new StringBuffer();
                     String initial = substringElement.getInitial();
                     String finalSegment = substringElement.getFinal();
                     if (initial != null && !initial.isEmpty()) {
-                        sb.append(Pattern.quote((String) normalizer.normalize(initial)));
+                        sb.append(Pattern.quote(DefaultStringNormalizer.normalizeString(initial)));
                     }
                     sb.append(".*");
                     for (Object segment : substringElement.getAny()) {
                         if (segment instanceof String) {
-                            sb.append(Pattern.quote((String) normalizer.normalize(segment)));
+                            sb.append(Pattern.quote(DefaultStringNormalizer.normalizeString((String)segment)));
                             sb.append(".*");
                         }
                     }
                     if (finalSegment != null && !finalSegment.isEmpty()) {
-                        sb.append(Pattern.quote((String) normalizer.normalize(finalSegment)));
+                        sb.append(Pattern.quote(DefaultStringNormalizer.normalizeString(finalSegment)));
                     }
                     Pattern pattern;
                     try {
@@ -207,40 +201,33 @@ public class LDAPFilterMatcher {
                 rawValues.close();
             }
             return false;
-        } catch (NamingException e1) {
+        } catch (NamingException | LdapException e1) {
             throw new DirectoryException("could not retrieve value for attribute: " + substringElement.getAttribute());
         }
     }
 
-    private Normalizer getNormalizer() {
-        if (normalizer == null) {
-            normalizer = new DefaultStringNormalizer();
-        }
-        return normalizer;
-    }
-
     /**
      * Handle conjunction, disjunction and negation nodes and recursively call the generic matcher on children.
      *
      * @return the boolean value of the evaluation of the sub expression
      */
     private boolean branchMatch(Attributes attributes, BranchNode branchElement) {
-        if (branchElement.isConjunction()) {
+        if (branchElement instanceof AndNode) {
             for (ExprNode child : branchElement.getChildren()) {
                 if (!recursiveMatch(attributes, child)) {
                     return false;
                 }
             }
             return true;
-        } else if (branchElement.isDisjunction()) {
+        } else if (branchElement instanceof OrNode) {
             for (ExprNode child : branchElement.getChildren()) {
                 if (recursiveMatch(attributes, child)) {
                     return true;
                 }
             }
             return false;
-        } else if (branchElement.isNegation()) {
-            return !recursiveMatch(attributes, branchElement.getChild());
+        } else if (branchElement instanceof NotNode) {
+            return !recursiveMatch(attributes, branchElement.getFirstChild());
         } else {
             throw new DirectoryException("unsupported branching filter element type: " + branchElement.toString());
         }
diff --git a/nuxeo-services/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPReference.java b/nuxeo-services/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPReference.java
index 77ca20a2462..87f8fe9141b 100644
--- a/nuxeo-services/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPReference.java
+++ b/nuxeo-services/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPReference.java
@@ -45,8 +45,9 @@ import javax.naming.ldap.Rdn;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.directory.shared.ldap.codec.util.LdapURL;
-import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.model.filter.LdapURL;
+import org.apache.directory.shared.ldap.model.filter.SearchScope;
+import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
 import org.nuxeo.common.xmap.annotation.XNode;
 import org.nuxeo.common.xmap.annotation.XNodeList;
 import org.nuxeo.common.xmap.annotation.XObject;
@@ -579,14 +580,14 @@ public class LDAPReference extends AbstractReference implements Cloneable {
                         try {
                             while (ldapUrls.hasMore()) {
                                 LdapURL ldapUrl = new LdapURL(ldapUrls.next().toString());
-                                String candidateDN = pseudoNormalizeDn(ldapUrl.getDn().getUpName());
+                                String candidateDN = pseudoNormalizeDn(ldapUrl.getDn().getName());
                                 // check base URL
                                 if (!targetDn.endsWith(candidateDN)) {
                                     continue;
                                 }
 
                                 // check onelevel scope constraints
-                                if (ldapUrl.getScope() == SearchControls.ONELEVEL_SCOPE) {
+                                if (ldapUrl.getScope().getScope() == SearchControls.ONELEVEL_SCOPE) {
                                     int targetDnSize = new LdapName(targetDn).size();
                                     int urlDnSize = new LdapName(candidateDN).size();
                                     if (targetDnSize - urlDnSize > 1) {
@@ -778,11 +779,11 @@ public class LDAPReference extends AbstractReference implements Cloneable {
                 try {
                     while (rawldapUrls.hasMore()) {
                         LdapURL ldapUrl = new LdapURL(rawldapUrls.next().toString());
-                        String linkDn = pseudoNormalizeDn(ldapUrl.getDn().getUpName());
+                        String linkDn = pseudoNormalizeDn(ldapUrl.getDn().getName());
                         String directoryDn = pseudoNormalizeDn(targetDirconfig.getSearchBaseDn());
                         int scope = SearchControls.ONELEVEL_SCOPE;
-                        int scopePart = ldapUrl.getScope();
-                        if (scopePart == SearchControls.SUBTREE_SCOPE) {
+                        SearchScope scopePart = ldapUrl.getScope();
+                        if (scopePart.getScope() == SearchControls.SUBTREE_SCOPE) {
                             scope = SearchControls.SUBTREE_SCOPE;
                         }
                         if (!linkDn.endsWith(directoryDn) && !directoryDn.endsWith(linkDn)) {
diff --git a/nuxeo-services/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPServerDescriptor.java b/nuxeo-services/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPServerDescriptor.java
index 9be8f730b8c..3973e651b19 100644
--- a/nuxeo-services/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPServerDescriptor.java
+++ b/nuxeo-services/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPServerDescriptor.java
@@ -23,6 +23,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
@@ -33,7 +34,11 @@ import javax.naming.NamingException;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.model.filter.LdapURL;
+import org.apache.directory.shared.ldap.model.name.Dn;
+import org.apache.directory.shared.ldap.model.name.Rdn;
+import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
 import org.nuxeo.common.xmap.annotation.XNode;
 import org.nuxeo.common.xmap.annotation.XNodeList;
 import org.nuxeo.common.xmap.annotation.XObject;
@@ -42,7 +47,6 @@ import org.nuxeo.ecm.directory.ldap.dns.DNSServiceEntry;
 import org.nuxeo.ecm.directory.ldap.dns.DNSServiceResolver;
 import org.nuxeo.ecm.directory.ldap.dns.DNSServiceResolverImpl;
 
-import com.sun.jndi.ldap.LdapURL;
 
 @XObject(value = "server")
 public class LDAPServerDescriptor {
@@ -175,15 +179,17 @@ public class LDAPServerDescriptor {
                 /*
                  * Parse the URI to make sure it is valid
                  */
-                ldapUrl = new LdapURL(url.getValue());
+                ldapUrl = new LdapURL();
+                ldapUrl.parse(url.getValue().toCharArray());
                 if (!processed.add(url)) {
                     continue;
                 }
-            } catch (NamingException e) {
+            } catch (LdapURLEncodingException e) {
                 throw new DirectoryException(e);
             }
 
-            useSsl = useSsl || ldapUrl.useSsl();
+            boolean ldaps = LDAPS_SCHEME.equals(ldapUrl.getScheme());
+            useSsl = useSsl || ldaps;
 
             /*
              * RFC-2255 - The "ldap" prefix indicates an entry or entries residing in the LDAP server running on the
@@ -194,14 +200,14 @@ public class LDAPServerDescriptor {
                 /*
                  * RFC-2782 - Check to see if an LDAP SRV record is defined in the DNS server
                  */
-                String domain = convertDNtoFQDN(ldapUrl.getDN());
+                String domain = convertDNtoFQDN(ldapUrl.getDn());
                 if (domain != null) {
                     /*
                      * Dynamic URL - retrieve from SRV record
                      */
                     List<String> discoveredUrls;
                     try {
-                        discoveredUrls = discoverLdapServers(domain, ldapUrl.useSsl(), url.getSrvPrefix());
+                        discoveredUrls = discoverLdapServers(domain, ldaps, url.getSrvPrefix());
                     } catch (NamingException e) {
                         throw new DirectoryException(String.format("SRV record DNS lookup failed for %s.%s: %s",
                                 url.getSrvPrefix(), domain, e.getMessage()), e);
@@ -215,7 +221,7 @@ public class LDAPServerDescriptor {
                     /*
                      * Store entries in an ordered set and remember that we were dynamic
                      */
-                    ldapEntries.add(new LdapEntryDomain(url, domain, ldapUrl.useSsl()));
+                    ldapEntries.add(new LdapEntryDomain(url, domain, ldaps));
                     isDynamicServerList = true;
                 } else {
                     throw new DirectoryException(
@@ -279,24 +285,20 @@ public class LDAPServerDescriptor {
      * @param dn base DN of the domain
      * @return the FQDN or null is DN is not matching the expected structure
      */
-    protected String convertDNtoFQDN(String dn) {
-        try {
-            LdapDN ldapDN = new LdapDN(dn);
-            Enumeration<String> components = ldapDN.getAll();
+    protected String convertDNtoFQDN(Dn ldapDN) {
+            Iterator<Rdn> components = ldapDN.iterator();
             List<String> domainComponents = new ArrayList<>();
-            while (components.hasMoreElements()) {
-                String component = components.nextElement();
-                if (component.startsWith("dc=")) {
-                    domainComponents.add(component.substring(3));
+            while (components.hasNext()) {
+                Rdn component = components.next();
+                if (component.getName().startsWith("dc=")) {
+                    domainComponents.add(component.getName().substring(3));
                 } else {
                     break;
                 }
             }
             Collections.reverse(domainComponents);
+            log.error(domainComponents);
             return StringUtils.join(domainComponents, ".");
-        } catch (InvalidNameException e) {
-            throw new DirectoryException(e);
-        }
     }
 
     public boolean isPoolingEnabled() {
diff --git a/nuxeo-services/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/test/java/org/nuxeo/ecm/directory/ldap/TestFilterMatcher.java b/nuxeo-services/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/test/java/org/nuxeo/ecm/directory/ldap/TestFilterMatcher.java
index 1a37f909d77..f64c70ffd12 100644
--- a/nuxeo-services/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/test/java/org/nuxeo/ecm/directory/ldap/TestFilterMatcher.java
+++ b/nuxeo-services/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/test/java/org/nuxeo/ecm/directory/ldap/TestFilterMatcher.java
@@ -24,7 +24,7 @@ package org.nuxeo.ecm.directory.ldap;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-import org.apache.directory.shared.ldap.message.AttributesImpl;
+import javax.naming.directory.BasicAttributes;
 import org.junit.Test;
 
 /**
@@ -41,7 +41,7 @@ public class TestFilterMatcher {
 
     @Test
     public void testAtomicFilter() throws Exception {
-        AttributesImpl attributes = new AttributesImpl();
+        BasicAttributes attributes = new BasicAttributes();
         attributes.put("attribute1", "value1");
         attributes.put("attribute2", "val$ue2");
         attributes.put("attribute3", "val^ue3");
@@ -85,7 +85,7 @@ public class TestFilterMatcher {
 
     @Test
     public void testCompoundFilter() throws Exception {
-        AttributesImpl attributes = new AttributesImpl();
+        BasicAttributes attributes = new BasicAttributes();
         attributes.put("attribute1", "value1");
         attributes.put("attribute2", "value2");
 
diff --git a/pom.xml b/pom.xml
index 49705221b2a..600277611a5 100755
--- a/pom.xml
+++ b/pom.xml
@@ -142,7 +142,7 @@
     <jna.version>4.5.2</jna.version>
     <netty.version>4.1.78.Final</netty.version>
     <apacheds.version>1.5.1</apacheds.version>
-    <apachedshared.version>0.9.7</apachedshared.version>
+    <apachedshared.version>1.0.0-M1</apachedshared.version>
     <gwt.version>2.7.0-NX1</gwt.version>
     <guice.version>3.0</guice.version>
     <jersey.version>1.19.4</jersey.version>
@@ -7205,4 +7205,4 @@
     </snapshotRepository>
   </distributionManagement>
 
-</project>
\ No newline at end of file
+</project>
