Improve keystore exception message when keystore is not valid (#4759)

Signed-off-by: Michael Mayer <michael@schnittstabil.de>
This commit is contained in:
Michael Mayer 2020-04-08 15:36:52 +02:00 committed by Joakim Erdfelt
parent 103c22dc43
commit 9079fa63b3
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
2 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ public class CertificateUtils
}
if (!store.exists())
throw new IllegalStateException("no valid keystore");
throw new IllegalStateException(store.getName() + " is not a valid keystore");
try (InputStream inStream = store.getInputStream())
{

View File

@ -244,7 +244,7 @@ public class SslContextFactoryTest
cf.setTrustStorePath("/foo");
cf.start();
});
assertThat(x.getMessage(), containsString("no valid keystore"));
assertThat(x.getMessage(), equalTo("/foo is not a valid keystore"));
}
}