mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-03-09 06:50:05 +00:00
Add support for ldaps:// urls. (Fix for SEC-146).
This commit is contained in:
parent
82be52cea0
commit
fbe5957c23
@ -129,7 +129,7 @@ public class DefaultInitialDirContextFactory implements InitialDirContextFactory
|
||||
|
||||
Assert.hasLength(url, "An LDAP connection URL must be supplied.");
|
||||
|
||||
if (url.startsWith("ldap:")) {
|
||||
if (url.startsWith("ldap:") || url.startsWith("ldaps:")) {
|
||||
|
||||
URI uri = LdapUtils.parseLdapUrl(url);
|
||||
|
||||
|
@ -40,6 +40,12 @@ public class DefaultInitialDirContextFactoryTests extends AbstractLdapServerTest
|
||||
|
||||
}
|
||||
|
||||
public void testSecureLdapUrlIsSupported() {
|
||||
idf = new DefaultInitialDirContextFactory("ldaps://localhost/dc=acegisecurity,dc=org");
|
||||
assertEquals("dc=acegisecurity,dc=org", idf.getRootDn());
|
||||
}
|
||||
|
||||
|
||||
public void testConnectionFailure() throws Exception {
|
||||
// Use the wrong port
|
||||
idf = new DefaultInitialDirContextFactory("ldap://localhost:60389");
|
||||
|
Loading…
x
Reference in New Issue
Block a user