diff options
author | Simon Rettberg | 2015-08-17 18:14:08 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-08-17 18:14:08 +0200 |
commit | 76f13bf7a26b79b0f4a45ec7992c4bcd8eeb9ee6 (patch) | |
tree | 172aa0259d6172f9881e3c02b84b0bdf58bb890c /dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java | |
parent | [server] Switch to libthrift 0.9.2 (diff) | |
download | tutor-module-76f13bf7a26b79b0f4a45ec7992c4bcd8eeb9ee6.tar.gz tutor-module-76f13bf7a26b79b0f4a45ec7992c4bcd8eeb9ee6.tar.xz tutor-module-76f13bf7a26b79b0f4a45ec7992c4bcd8eeb9ee6.zip |
[server] Add TLS/SSL related classes and functionality (wip)
Diffstat (limited to 'dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java')
-rw-r--r-- | dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java index 5ceb72cc..e7d0b9aa 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java @@ -1,5 +1,6 @@ package org.openslx.bwlp.sat; +import java.io.IOException; import java.security.NoSuchAlgorithmException; import java.sql.SQLException; import java.util.ArrayList; @@ -16,6 +17,7 @@ import org.openslx.bwlp.sat.thrift.BinaryListener; import org.openslx.bwlp.sat.thrift.cache.OperatingSystemList; import org.openslx.bwlp.sat.thrift.cache.OrganizationList; import org.openslx.bwlp.sat.util.Configuration; +import org.openslx.bwlp.sat.util.Identity; import org.openslx.bwlp.sat.util.Json; import org.openslx.bwlp.thrift.iface.ImageSummaryRead; import org.openslx.bwlp.thrift.iface.NetDirection; @@ -34,7 +36,7 @@ public class App { public static boolean DEBUG = false; - public static void main(String[] args) throws TTransportException, NoSuchAlgorithmException { + public static void main(String[] args) throws TTransportException, NoSuchAlgorithmException, IOException { //get going and show basic information in log file BasicConfigurator.configure(); if (args.length != 0 && args[0].equals("debug")) { @@ -53,6 +55,11 @@ public class App { System.exit(1); } + if (Identity.loadCertificate() == null) { + LOGGER.error("Could not set up TLS/SSL requirements, exiting"); + System.exit(1); + } + ThriftManager.setErrorCallback(new ErrorCallback() { @Override @@ -81,11 +88,16 @@ public class App { LOGGER.error("Could not start internal file server."); return; } - // Start Server + // Start Thrift Server Thread t; + // Plain t = new Thread(new BinaryListener(9090, false)); servers.add(t); t.start(); + // SSL + t = new Thread(new BinaryListener(9091, true)); + servers.add(t); + t.start(); // DEBUG if (DEBUG) { Database.printCharsetInformation(); @@ -124,5 +136,4 @@ public class App { QuickTimer.cancel(); LOGGER.info(new Date() + " - all Servers shut down, exiting...\n"); } - } |