[test] Create keystore with the keytool of the running JDK
Call keytool with the absolute path of "java.home". Otherwise a keytool
for a different, maybe even newer Java version might be picked up, and
then the keystore may not be readable by the JVM used to run the tests.
(cherry picked from commit 2d73c702d3
)
Change-Id: Iea77024947a34267f008847d81312fe0abadc615
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
This commit is contained in:
parent
e7b4af0d95
commit
6cb39d145a
|
@ -214,9 +214,12 @@ private SslContextFactory createTestSslContextFactory(String hostName) {
|
||||||
tmpDir.deleteOnExit();
|
tmpDir.deleteOnExit();
|
||||||
makePrivate(tmpDir);
|
makePrivate(tmpDir);
|
||||||
File keyStore = new File(tmpDir, "keystore.jks");
|
File keyStore = new File(tmpDir, "keystore.jks");
|
||||||
|
File keytool = new File(
|
||||||
|
new File(new File(System.getProperty("java.home")), "bin"),
|
||||||
|
"keytool");
|
||||||
Runtime.getRuntime().exec(
|
Runtime.getRuntime().exec(
|
||||||
new String[] {
|
new String[] {
|
||||||
"keytool", //
|
keytool.getAbsolutePath(), //
|
||||||
"-keystore", keyStore.getAbsolutePath(), //
|
"-keystore", keyStore.getAbsolutePath(), //
|
||||||
"-storepass", keyPassword,
|
"-storepass", keyPassword,
|
||||||
"-alias", hostName, //
|
"-alias", hostName, //
|
||||||
|
|
Loading…
Reference in New Issue