]> source.dussan.org Git - jgit.git/commitdiff
[test] Create keystore with the keytool of the running JDK 71/183471/1
authorThomas Wolf <thomas.wolf@paranor.ch>
Sun, 25 Jul 2021 13:44:35 +0000 (15:44 +0200)
committerThomas Wolf <thomas.wolf@paranor.ch>
Thu, 29 Jul 2021 10:47:16 +0000 (12:47 +0200)
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 <thomas.wolf@paranor.ch>
org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java

index 9aef086b78a2b74044c3b57e963b92a537516739..ba0138b81eae440ca83b9c32bb140c3ade490ee8 100644 (file)
@@ -214,9 +214,12 @@ public class AppServer {
                        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, //