Skip to content

Commit

Permalink
[ELY-2704] Missing keystore password does not throw a meaningful exce…
Browse files Browse the repository at this point in the history
…ption
  • Loading branch information
lvydra committed Sep 19, 2024
1 parent bab0267 commit aefc98a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3649,6 +3649,9 @@ protected AbstractLoadingKeyStoreFactory(final ExceptionSupplier<KeyStore, Confi
public KeyStore get() throws ConfigXMLParseException {
try {
KeyStore keyStore = delegateFactory.get();
if (passwordFactory == null || passwordFactory.get() == null) {
xmlLog.noKeystorePasswordSpecified(location);
}
try (InputStream fis = createStream()) {
keyStore.load(fis, passwordFactory == null ? null : passwordFactory.get());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.wildfly.security.auth.client._private;

import static org.jboss.logging.Logger.Level.INFO;
import static org.jboss.logging.Logger.Level.WARN;

import java.io.IOException;
Expand Down Expand Up @@ -129,6 +130,10 @@ ConfigXMLParseException xmlDuplicateAuthenticationConfigurationName(String name,
ConfigXMLParseException xmlInvalidKeyStoreEntryType(@Param Location location, String alias, Class<?> expectedClass,
Class<?> actualClass);

@LogMessage(level = INFO)
@Message(id = 1138, value = "No Keystore password specified \"%s\"")
void noKeystorePasswordSpecified(Location location);

@Message(id = 1139, value = "Failed to create credential store")
ConfigXMLParseException xmlFailedToCreateCredentialStore(@Param Location location, @Cause Throwable cause);

Expand Down

0 comments on commit aefc98a

Please sign in to comment.