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 Aug 13, 2024
1 parent bab0267 commit c4efb83
Show file tree
Hide file tree
Showing 2 changed files with 7 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 @@ -129,6 +129,10 @@ ConfigXMLParseException xmlDuplicateAuthenticationConfigurationName(String name,
ConfigXMLParseException xmlInvalidKeyStoreEntryType(@Param Location location, String alias, Class<?> expectedClass,
Class<?> actualClass);

@LogMessage(level = WARN)
@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 c4efb83

Please sign in to comment.