From 6cb39d145acbd535da00993cf8c200b16653ba71 Mon Sep 17 00:00:00 2001 From: Thomas Wolf Date: Sun, 25 Jul 2021 15:44:35 +0200 Subject: [PATCH] [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 2d73c702d3e9128b7dc03a01fe2cf18f119d3ffe) Change-Id: Iea77024947a34267f008847d81312fe0abadc615 Signed-off-by: Thomas Wolf --- .../src/org/eclipse/jgit/junit/http/AppServer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java index 9aef086b7..ba0138b81 100644 --- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java +++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java @@ -214,9 +214,12 @@ private SslContextFactory createTestSslContextFactory(String hostName) { tmpDir.deleteOnExit(); makePrivate(tmpDir); File keyStore = new File(tmpDir, "keystore.jks"); + File keytool = new File( + new File(new File(System.getProperty("java.home")), "bin"), + "keytool"); Runtime.getRuntime().exec( new String[] { - "keytool", // + keytool.getAbsolutePath(), // "-keystore", keyStore.getAbsolutePath(), // "-storepass", keyPassword, "-alias", hostName, //