From 7070eb61b831d1596940823b2e0b78fffbace9bc Mon Sep 17 00:00:00 2001 From: Charles Gould Date: Tue, 10 Oct 2017 17:57:13 -0400 Subject: [PATCH] Log security provider registration failures --- src/main/java/net/schmizz/sshj/common/SecurityUtils.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/schmizz/sshj/common/SecurityUtils.java b/src/main/java/net/schmizz/sshj/common/SecurityUtils.java index 62da004e5..96a0b8841 100644 --- a/src/main/java/net/schmizz/sshj/common/SecurityUtils.java +++ b/src/main/java/net/schmizz/sshj/common/SecurityUtils.java @@ -69,15 +69,15 @@ public static boolean registerSecurityProvider(String providerClassName) { } if (securityProvider == null) { - MessageDigest.getInstance("MD5", provider.getName()); - KeyAgreement.getInstance("DH", provider.getName()); + MessageDigest.getInstance("MD5", provider); + KeyAgreement.getInstance("DH", provider); setSecurityProvider(provider.getName()); return true; } } catch (NoSuchAlgorithmException e) { LOG.info(format("Security Provider '%s' does not support necessary algorithm", providerClassName), e); - } catch (NoSuchProviderException e) { - LOG.info("Registration of Security Provider '{}' unexpectedly failed", providerClassName); + } catch (Exception e) { + LOG.info(format("Registration of Security Provider '%s' unexpectedly failed", providerClassName), e); } return false; }