X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=util-testing%2Forg%2Fcacert%2Fgigi%2FDevelLauncher.java;h=c32b6b30a6c83240735857e2283007119124466b;hp=df5a790d24297fd728316c9e0978da3ae8924eb7;hb=ab77de9b22988a2cedc35408769b9042073056f5;hpb=98589287b0df86241c9df29ef924ff5c943b0be2 diff --git a/util-testing/org/cacert/gigi/DevelLauncher.java b/util-testing/org/cacert/gigi/DevelLauncher.java index df5a790d..c32b6b30 100644 --- a/util-testing/org/cacert/gigi/DevelLauncher.java +++ b/util-testing/org/cacert/gigi/DevelLauncher.java @@ -16,6 +16,7 @@ import java.lang.reflect.Field; import java.net.URISyntaxException; import java.net.URL; import java.nio.file.Files; +import java.nio.file.Path; import java.nio.file.Paths; import java.util.Collections; import java.util.HashMap; @@ -55,7 +56,13 @@ public class DevelLauncher { ByteArrayOutputStream chunkConfig = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(chunkConfig); byte[] cacerts = Files.readAllBytes(Paths.get("config/cacerts.jks")); - byte[] keystore = Files.readAllBytes(Paths.get("config/keystore.pkcs12")); + byte[] keystore = null; + Path p = Paths.get("config/keystore.pkcs12"); + if (p.toFile().exists()) { + keystore = Files.readAllBytes(p); + } else { + mainProps.setProperty("proxy", "true"); + } DevelLauncher.writeGigiConfig(dos, "changeit".getBytes("UTF-8"), "changeit".getBytes("UTF-8"), mainProps, cacerts, keystore); dos.flush(); @@ -229,6 +236,9 @@ public class DevelLauncher { } private static void putTarEntry(byte[] data, TarOutputStream tos, String name) throws IOException { + if (data == null) { + return; + } TarHeader th = new TarHeader(); th.name = new StringBuffer(name); th.size = data.length;