diff --git a/engine-api/src/test/java/io/nosqlbench/engine/api/util/SSLKsFactoryTest.java b/engine-api/src/test/java/io/nosqlbench/engine/api/util/SSLKsFactoryTest.java index 11211aef5..8e4892fc9 100644 --- a/engine-api/src/test/java/io/nosqlbench/engine/api/util/SSLKsFactoryTest.java +++ b/engine-api/src/test/java/io/nosqlbench/engine/api/util/SSLKsFactoryTest.java @@ -162,7 +162,7 @@ public class SSLKsFactoryTest { NBConfiguration sslCfg = SSLKsFactory.get().getConfigModel().extractConfig(activityDef.getParams()); assertThatExceptionOfType(RuntimeException.class) .isThrownBy(() -> SSLKsFactory.get().getContext(sslCfg)) - .withMessageMatching("Unable to load the keystore. Please check."); + .withMessageMatching("Unable to load the keystore: .*"); } @Test @@ -192,7 +192,7 @@ public class SSLKsFactoryTest { NBConfiguration sslCfg = SSLKsFactory.get().getConfigModel().extractConfig(activityDef.getParams()); assertThatExceptionOfType(RuntimeException.class) .isThrownBy(() -> SSLKsFactory.get().getContext(sslCfg)) - .withMessageMatching("Unable to load the truststore. Please check."); + .withMessageMatching("Unable to load the truststore: .*"); } @Test diff --git a/nb-api/src/main/java/io/nosqlbench/engine/api/util/SSLKsFactory.java b/nb-api/src/main/java/io/nosqlbench/engine/api/util/SSLKsFactory.java index e8c227069..de90ea843 100644 --- a/nb-api/src/main/java/io/nosqlbench/engine/api/util/SSLKsFactory.java +++ b/nb-api/src/main/java/io/nosqlbench/engine/api/util/SSLKsFactory.java @@ -98,7 +98,7 @@ public class SSLKsFactory implements NBMapConfigurable { try { return KeyStore.getInstance(new File(ksPath), keyStorePassword); } catch (Exception e) { - throw new RuntimeException("Unable to load the keystore. Please check.", e); + throw new RuntimeException("Unable to load the keystore: " + e, e); } }).orElse(null); @@ -109,7 +109,7 @@ public class SSLKsFactory implements NBMapConfigurable { .map(String::toCharArray) .orElse(null)); } catch (Exception e) { - throw new RuntimeException("Unable to load the truststore. Please check.", e); + throw new RuntimeException("Unable to load the truststore: " + e, e); } }).orElse(null); @@ -125,7 +125,7 @@ public class SSLKsFactory implements NBMapConfigurable { return cf.generateCertificate(is); } catch (Exception e) { throw new RuntimeException( - String.format("Unable to load cert from %s. Please check.", certFilePath), + String.format("Unable to load cert from %s: " + e, certFilePath), e ); } @@ -148,7 +148,7 @@ public class SSLKsFactory implements NBMapConfigurable { keyStore.setKeyEntry("key", key, keyPassword, cert != null ? new Certificate[]{cert} : null); } catch (Exception e) { - throw new RuntimeException(String.format("Unable to load key from %s. Please check.", + throw new RuntimeException(String.format("Unable to load key from %s: " + e, keyFile), e); } @@ -163,7 +163,7 @@ public class SSLKsFactory implements NBMapConfigurable { ts.setCertificateEntry("caCertFile", caCert); return ts; } catch (Exception e) { - throw new RuntimeException(String.format("Unable to load caCert from %s. Please check.", + throw new RuntimeException(String.format("Unable to load caCert from %s: " + e, caCertFilePath), e); } @@ -183,7 +183,7 @@ public class SSLKsFactory implements NBMapConfigurable { kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); kmf.init(keyStore, keyPassword); } catch (Exception e) { - throw new RuntimeException("Unable to init KeyManagerFactory. Please check password and location.", e); + throw new RuntimeException("Unable to init KeyManagerFactory. Please check password and location: " + e, e); } TrustManagerFactory tmf; @@ -191,7 +191,7 @@ public class SSLKsFactory implements NBMapConfigurable { tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); tmf.init(trustStore != null ? trustStore : keyStore); } catch (Exception e) { - throw new RuntimeException("Unable to init TrustManagerFactory. Please check.", e); + throw new RuntimeException("Unable to init TrustManagerFactory: " + e, e); } try {