summaryrefslogtreecommitdiff
path: root/BKUWebStart/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'BKUWebStart/src/main')
-rw-r--r--BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java1
-rw-r--r--BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java19
-rw-r--r--BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/MOCCAIcon.java19
3 files changed, 27 insertions, 12 deletions
diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java
index ee951a4b..026a947f 100644
--- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java
+++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java
@@ -135,7 +135,6 @@ public class Launcher implements BKUControllerInterface {
}
private Configurator config;
private Container server;
-// private BasicService basicService;
private StatusNotifier status;
private Autostart autostart;
diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java
index 4b817ae1..379b9711 100644
--- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java
+++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java
@@ -56,7 +56,8 @@ import org.slf4j.LoggerFactory;
public class TLSServerCA {
public static final int CA_VALIDITY_Y = 3;
public static final String MOCCA_TLS_SERVER_ALIAS = "server";
- public static final int SERVER_VALIDITY_Y = 3;
+ public static final int SERVER_VALIDITY_Y = 3;
+ public static final int SERVER_VALIDITY_Y_MAC = 2;
private final static Logger log = LoggerFactory.getLogger(TLSServerCA.class);
private KeyPair caKeyPair;
@@ -139,14 +140,26 @@ public class TLSServerCA {
GregorianCalendar date = new GregorianCalendar();
date.add(Calendar.HOUR_OF_DAY, -1);
- serverCert.setValidNotBefore(date.getTime());
- date.add(Calendar.YEAR,SERVER_VALIDITY_Y);
+ serverCert.setValidNotBefore(date.getTime());
+ if (isMacOs()) {
+ date.add(Calendar.YEAR,SERVER_VALIDITY_Y_MAC);
+ } else {
+ date.add(Calendar.YEAR,SERVER_VALIDITY_Y);
+ }
date.add(Calendar.HOUR_OF_DAY, -1);
serverCert.setValidNotAfter(date.getTime());
serverCert.sign(AlgorithmID.sha256WithRSAEncryption, caKeyPair.getPrivate());
log.debug("successfully generated MOCCA TLS Server certificate " + serverCert.getSubjectDN());
caKeyPair = null;
+ }
+
+ private boolean isMacOs() {
+ String os = System.getProperty("os.name").toLowerCase();
+ if (os.contains("mac")) {
+ return true;
+ }
+ return false;
}
public KeyStore generateKeyStore(char[] password) throws GeneralSecurityException, IOException, CodingException {
diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/MOCCAIcon.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/MOCCAIcon.java
index 1b9996fc..c12ffde0 100644
--- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/MOCCAIcon.java
+++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/MOCCAIcon.java
@@ -152,14 +152,17 @@ public class MOCCAIcon implements StatusNotifier, ActionListener, ItemListener {
Menu settingsMenu = new Menu(messages.getString(LABEL_SETTINGS));
menu.add(settingsMenu);
- CheckboxMenuItem autostartItem = new CheckboxMenuItem(
- messages.getString(LABEL_AUTOSTART));
- autostartItem.addItemListener(this);
- autostartItem.setActionCommand(COMMANDS.AUTOSTART_COMMAND.name());
- autostartItem.setState(controller.isAutostartEnabled());
- autostartItem.setEnabled(controller.isAutostartPossible());
- settingsMenu.add(autostartItem);
-
+ // only add autostart for older java versions
+ String version = System.getProperty("java.version");
+ if (version.startsWith("1.")) {
+ CheckboxMenuItem autostartItem = new CheckboxMenuItem(
+ messages.getString(LABEL_AUTOSTART));
+ autostartItem.addItemListener(this);
+ autostartItem.setActionCommand(COMMANDS.AUTOSTART_COMMAND.name());
+ autostartItem.setState(controller.isAutostartEnabled());
+ autostartItem.setEnabled(controller.isAutostartPossible());
+ settingsMenu.add(autostartItem);
+ }
menu.addSeparator();
MenuItem shutdownItem = new MenuItem(