diff --git a/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/connection/LdapConnection.java b/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/connection/LdapConnection.java index 666be5e3..fc5c27ab 100644 --- a/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/connection/LdapConnection.java +++ b/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/connection/LdapConnection.java @@ -26,6 +26,7 @@ import org.slf4j.LoggerFactory; import javax.naming.Context; import javax.naming.NamingException; import javax.naming.directory.DirContext; +import javax.naming.directory.InitialDirContext; import javax.naming.ldap.LdapName; import javax.naming.ldap.Rdn; import java.util.Collections; @@ -153,7 +154,7 @@ public class LdapConnection if ( config.getHostname() != null ) { - String protocol = config.isSsl() ? "ldaps" : "ldap"; + String protocol = "ldap";// config.isSsl() ? "ldaps" : "ldap"; if ( config.getPort() != 0 ) { env.put( Context.PROVIDER_URL, protocol + "://" + config.getHostname() + ":" + config.getPort() + "/" ); @@ -164,6 +165,11 @@ public class LdapConnection } } + if ( config.isSsl() ) + { + env.put( Context.SECURITY_PROTOCOL, "ssl" ); + } + if ( config.getAuthenticationMethod() != null ) { env.put( Context.SECURITY_AUTHENTICATION, config.getAuthenticationMethod() );