X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2FLauncher.java;h=cff94772eff804d85593d9f537858ea887dd4254;hp=7bf5bd119554387739d8b07a2647342cde3f82df;hb=49b85ef92acaa7b62acdfd89aac04680f7c25154;hpb=aa5723dbb64ec8efa63909d39ff72364f0a5ee96 diff --git a/src/org/cacert/gigi/Launcher.java b/src/org/cacert/gigi/Launcher.java index 7bf5bd11..cff94772 100644 --- a/src/org/cacert/gigi/Launcher.java +++ b/src/org/cacert/gigi/Launcher.java @@ -1,7 +1,11 @@ package org.cacert.gigi; import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; import java.io.IOException; +import java.net.HttpURLConnection; import java.net.InetSocketAddress; import java.security.GeneralSecurityException; import java.security.Key; @@ -95,18 +99,25 @@ public class Launcher { public static void main(String[] args) throws Exception { System.setProperty("jdk.tls.ephemeralDHKeySize", "4096"); - new Launcher().boot(); + InputStream in; + if (args.length >= 1) { + in = new FileInputStream(new File(args[0])); + } else { + in = System.in; + } + new Launcher().boot(in); } Server s; GigiConfig conf; - public synchronized void boot() throws Exception { + public synchronized void boot(InputStream in) throws Exception { Locale.setDefault(Locale.ENGLISH); TimeZone.setDefault(TimeZone.getTimeZone("UTC")); + HttpURLConnection.setFollowRedirects(false); - conf = GigiConfig.parse(System.in); + conf = GigiConfig.parse(in); ServerConstants.init(conf.getMainProps()); initEmails(conf);