diff options
author | Simon Rettberg | 2015-08-18 19:49:30 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-08-18 19:49:30 +0200 |
commit | 6e1b0f5a5da9bb8f73ff62166d09647d9d479ad8 (patch) | |
tree | 2b8dd3e12f96f2dbd5df8fa7caa1e8c34af06745 /dozentenmodul/src/main/java/org/openslx/dozmod/App.java | |
parent | [client] Remove old unused class (diff) | |
download | tutor-module-6e1b0f5a5da9bb8f73ff62166d09647d9d479ad8.tar.gz tutor-module-6e1b0f5a5da9bb8f73ff62166d09647d9d479ad8.tar.xz tutor-module-6e1b0f5a5da9bb8f73ff62166d09647d9d479ad8.zip |
[client] Use TLS to talk to master and satellite
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/App.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/App.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/App.java b/dozentenmodul/src/main/java/org/openslx/dozmod/App.java index 29e6d961..4be5a34d 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/App.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/App.java @@ -8,11 +8,13 @@ import java.awt.event.ComponentEvent; import java.awt.event.ContainerEvent; import java.io.File; import java.io.IOException; +import java.security.NoSuchAlgorithmException; import java.util.HashSet; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; +import javax.net.ssl.SSLContext; import javax.swing.SwingUtilities; import javax.swing.UIDefaults; import javax.swing.UIManager; @@ -35,6 +37,12 @@ public class App { // Logger private final static Logger LOGGER = Logger.getLogger(App.class); + public static final int THRIFT_PORT = 9090; + + public static final int THRIFT_SSL_PORT = THRIFT_PORT + 1; + + public static final int THRIFT_TIMEOUT_MS = 15000; + private static Thread proxyThread = null; private static void setupLogger() { @@ -141,7 +149,17 @@ public class App { // setup global thrift connection error handler before anything else // Set master server to use (TODO: make configurable via command line) - ThriftManager.setMasterServerAddress("bwlp-masterserver.ruf.uni-freiburg.de"); + try { + ThriftManager.setMasterServerAddress(SSLContext.getDefault(), "bwlp-masterserver.ruf.uni-freiburg.de", THRIFT_SSL_PORT, + THRIFT_TIMEOUT_MS); + } catch (final NoSuchAlgorithmException e1) { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + Gui.showMessageBox(null, "SSL nicht verfügbar", MessageType.ERROR, LOGGER, e1); + } + }); + } SwingUtilities.invokeLater(new Runnable() { @Override |