mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Embedded LDAP SSL should not be enabled when its bundle is empty
See gh-50700 Signed-off-by: leestana01 <leestana01@naver.com>
This commit is contained in:
committed by
Stéphane Nicoll
parent
f9fcaa2a67
commit
af2f956c7d
+2
-1
@@ -24,6 +24,7 @@ import org.jspecify.annotations.Nullable;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.convert.Delimiter;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Configuration properties for Embedded LDAP.
|
||||
@@ -150,7 +151,7 @@ public class EmbeddedLdapProperties {
|
||||
private @Nullable String bundle;
|
||||
|
||||
public boolean isEnabled() {
|
||||
return (this.enabled != null) ? this.enabled : this.bundle != null;
|
||||
return (this.enabled != null) ? this.enabled : StringUtils.hasText(this.bundle);
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
|
||||
+7
@@ -411,6 +411,13 @@ class EmbeddedLdapAutoConfigurationTests {
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void sslIsNotEnabledWhenBundleIsEmpty() {
|
||||
EmbeddedLdapProperties properties = new EmbeddedLdapProperties();
|
||||
properties.getSsl().setBundle("");
|
||||
assertThat(properties.getSsl().isEnabled()).isFalse();
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
static class LdapClientConfiguration {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user