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 GitHub
parent 3981ec1342
commit a640701d78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

@ -217,7 +217,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"));
}
}