mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 20:19:06 +00:00
Replace the hand-rolled LdapContextSource of the embedded server with an LdapConnectionDetails implementation, so that LdapAutoConfiguration creates the context source for both the external and the embedded case. Previously, the embedded context source derived the URL scheme from spring.ldap.ssl and never applied an SSL bundle to the JNDI environment, leaving an embedded LDAPS server unreachable. It also ignored spring.ldap.anonymous-read-only, spring.ldap.referral, spring.ldap.base-environment and any DirContextAuthenticationStrategy bean, all of which now apply. The embedded server provides everything that describes a connection to it, so spring.ldap.urls, spring.ldap.username, spring.ldap.password and spring.ldap.ssl are now ignored while it is used. A spring.ldap configuration meant for a production server therefore no longer has to be unset for a test to run against the embedded server. This is a behavior change: spring.ldap.urls used to take precedence and silently pointed the client away from the embedded server. As spring.ldap.base-environment now applies to the embedded case, a socket factory set there would be replaced by the one of the SSL bundle. Startup fails instead of using either silently. LdapProperties.determineUrls has been removed. Its local.ldap.port handling only ever served the embedded case, which the embedded connection details now cover, and the default URL derivation has moved to PropertiesLdapConnectionDetails, its only caller. Closes gh-51465