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>
(cherry picked from commit eac43822c342802512e226f9692c91aa12ae4fef)
This commit is contained in:
Stefan Guilhen 2024-02-09 10:38:48 -03:00 committed by Alexander Schwartz
parent 6c2433634b
commit c7a20935e7

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() {