Skip to content

Commit

Permalink
PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chkead committed Feb 5, 2024
1 parent 058b075 commit 9602ba9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/hivemq/security/ssl/SslContextFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ private static Map<String, String> createDnsHostnameMap(

aliases = keystore.aliases();
} catch (final IOException | NoSuchAlgorithmException | CertificateException | KeyStoreException e) {
log.warn("Failed to open keystore for certificate processing");
log.warn("Failed to open keystore for certificate processing, the message is: {}", e.getMessage());

return Collections.emptyMap();
}

if (aliases == null) {
if (aliases == null || !aliases.hasMoreElements()) {
return Collections.emptyMap();
}

Expand All @@ -170,7 +170,7 @@ private static Map<String, String> createDnsHostnameMap(
try {
certificateChain = keystore.getCertificateChain(alias);
} catch (final KeyStoreException e) {
log.warn("Failed to get certificate with alias {} from keystore", alias);
log.warn("Failed to get certificate with alias {} from keystore, the message is: {}", alias, e.getMessage());
continue;
}

Expand All @@ -186,7 +186,7 @@ private static Map<String, String> createDnsHostnameMap(
try {
dnsHostnames = getDnsHostnamesFromCertificate(x509Cert);
} catch (final CertificateParsingException e) {
log.warn("Failed to parse certificate for alias: {}", alias);
log.warn("Failed to parse certificate for alias: {}, the message is: {}", alias, e.getMessage());
}

if (dnsHostnames == null) {
Expand Down

0 comments on commit 9602ba9

Please sign in to comment.