Avoid changing the config value for the useTruststoreSpi property

- prevents cached LDAPConfig entry from changing when retrieving this value

Closes #25912

Signed-off-by: Stefan Guilhen <sguilhen@redhat.com>
This commit is contained in:
Stefan Guilhen 2024-02-09 10:38:48 -03:00 committed by Alexander Schwartz
parent e50642ac32
commit eac43822c3

View file

@ -66,11 +66,7 @@ public class LDAPConfig {
public String getUseTruststoreSpi() {
String value = config.getFirst(LDAPConstants.USE_TRUSTSTORE_SPI);
if (LDAPConstants.USE_TRUSTSTORE_LDAPS_ONLY.equals(value)) {
value = LDAPConstants.USE_TRUSTSTORE_ALWAYS;
config.putSingle(LDAPConstants.USE_TRUSTSTORE_SPI, value);
}
return value;
return LDAPConstants.USE_TRUSTSTORE_LDAPS_ONLY.equals(value) ? LDAPConstants.USE_TRUSTSTORE_ALWAYS : value;
}
public String getUsersDn() {