Skip to content

Add Sample Showing DefaultTlsDirContextAuthenticationStrategy #12

Open

Description

@jzheaux

How to secure the connection to an LDAP server is one of the most common questions about Spring LDAP, and this repository has no sample that answers it. The only TLS-related content is an ldaps:// URL in the user-admin README; nothing configures DefaultTlsDirContextAuthenticationStrategy.

Please add a Spring Boot sample that shows how to configure LdapContextSource with DefaultTlsDirContextAuthenticationStrategy (STARTTLS), including:

  • the strategy bean and how it is wired into the LdapContextSource
  • how to supply a trust store / SSLSocketFactory (ideally via a Spring Boot SSL bundle)
  • hostname verification, and why a custom HostnameVerifier should not simply accept everything
  • how this differs from using an ldaps:// URL

The sample needs a server that offers STARTTLS, so it will need either an embedded server configured with a certificate or a documented way to point it at an external one.

This sample is also intended to be the recommended replacement for the DIGEST-MD5 documentation once DigestMd5DirContextAuthenticationStrategy is deprecated, so the Spring LDAP reference documentation should link to it.

Activity

  1. added
    enhancement
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions