From 29ab886c64b91e8628f1c621452cd22771ea042a Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 1 May 2013 12:15:54 +0000 Subject: [PATCH] ensure we use ssl and ldaps is deprecated git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1477967 13f79535-47bb-0310-9956-ffa450edef68 --- .../redback/common/ldap/connection/LdapConnection.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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() );