diff options
| author | Simon Rettberg | 2015-09-10 11:38:25 +0200 |
|---|---|---|
| committer | Simon Rettberg | 2015-09-10 11:38:25 +0200 |
| commit | 4ef812cdb8cb7eb294dba5837cad750deaa52da9 (patch) | |
| tree | d9c355fb3b2360d54c4d63c6784908eb38bc6e6b /dozentenmodulserver/src/main/java | |
| parent | [server] Make xml compatible with legacy run-virt (diff) | |
| download | tutor-module-4ef812cdb8cb7eb294dba5837cad750deaa52da9.tar.gz tutor-module-4ef812cdb8cb7eb294dba5837cad750deaa52da9.tar.xz tutor-module-4ef812cdb8cb7eb294dba5837cad750deaa52da9.zip | |
[*] Improve SSL handling
Diffstat (limited to 'dozentenmodulserver/src/main/java')
| -rw-r--r-- | dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java | 11 | ||||
| -rw-r--r-- | dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/Configuration.java | 4 |
2 files changed, 10 insertions, 5 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 425a3384..2648310b 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java @@ -1,6 +1,7 @@ package org.openslx.bwlp.sat; import java.io.IOException; +import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.sql.SQLException; import java.util.Date; @@ -44,7 +45,8 @@ public class App { private static final Set<String> failFastMethods = new HashSet<>(); - public static void main(String[] args) throws TTransportException, NoSuchAlgorithmException, IOException { + public static void main(String[] args) throws TTransportException, NoSuchAlgorithmException, IOException, + KeyManagementException { //get going and show basic information in log file BasicConfigurator.configure(); if (args.length != 0 && args[0].equals("debug")) { @@ -94,10 +96,11 @@ public class App { SSLContext ctx = null; if (Configuration.getMasterServerSsl()) { - ctx = SSLContext.getDefault(); + ctx = SSLContext.getInstance("TLSv1.2"); + ctx.init(null, null, null); } - ThriftManager.setMasterServerAddress(ctx, // TODO: Use the TLSv1.2 one once the master is ready - Configuration.getMasterServerAddress(), Configuration.getMasterServerPort(), 30000); + ThriftManager.setMasterServerAddress(ctx, Configuration.getMasterServerAddress(), + Configuration.getMasterServerPort(), 30000); // Load useful things from master server OrganizationList.get(); diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/Configuration.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/Configuration.java index b9652a0c..c8208338 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/Configuration.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/Configuration.java @@ -40,7 +40,9 @@ public class Configuration { dbUsername = prop.getProperty("db.username"); dbPassword = prop.getProperty("db.password"); masterAddress = prop.getProperty("master.address"); - masterSsl = Boolean.getBoolean(prop.getProperty("master.ssl")); + if (!Util.isEmptyString(prop.getProperty("master.ssl"))) { + masterSsl = Boolean.getBoolean(prop.getProperty("master.ssl")); + } try { masterPort = Integer.parseInt(prop.getProperty("master.port")); } catch (Exception e) { |
