Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
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.
Expand Down Expand Up @@ -150,7 +151,7 @@ public static class Ssl {
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,13 @@ void whenInvalidSslBundleIsConfiguredThenStartFails() {
});
}

@Test
void sslIsNotEnabledWhenBundleIsEmpty() {
EmbeddedLdapProperties properties = new EmbeddedLdapProperties();
properties.getSsl().setBundle("");
assertThat(properties.getSsl().isEnabled()).isFalse();
}

@Configuration(proxyBeanMethods = false)
static class LdapClientConfiguration {

Expand Down