Skip to content
This repository has been archived by the owner on May 7, 2019. It is now read-only.

Commit

Permalink
Added optional SSL support
Browse files Browse the repository at this point in the history
  • Loading branch information
TAAPArthur committed Apr 3, 2017
1 parent ce198e8 commit 37690b4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Syncrop/SyncropDaemon/src/settings/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class Settings {
* The port to connect on the server
*/
static private int port;
static private int sslPort;
static private boolean autoStart=false;

static final String settingsFileName="syncrop.settings";
Expand Down Expand Up @@ -92,6 +93,8 @@ public class Settings {
*/
public static int getPort() {return port;}
public static void setPort(int port) {Settings.port=port;}
public static int getSSLPort() {return sslPort;}
public static void setSSLPort(int port) {Settings.sslPort=port;}

/**
*
Expand Down Expand Up @@ -215,5 +218,26 @@ public static void setUniversalRestrictions(String s){
public static String getUniversalRestrictions(){
return Account.getUniversalRestrictions();
}
private static String trustStoreFile;
public static String getTrustStoreFile(){
return trustStoreFile;
}
public static void setTrustStoreFile(String f){
System.setProperty("javax.net.ssl.trustStore",trustStoreFile=f);
}
private static String trustStorePassword="cacerts";
public static String getTrustStorePassord(){
return trustStorePassword;
}
public static void setTrustStorePassword(String f){
System.setProperty("javax.net.ssl.trustStorePassword",trustStorePassword=f);
}
private static boolean sslConnection=false;
public static boolean isSSLConnection(){
return sslConnection;
}
public static void setSSLConnection(boolean b){
sslConnection=b;
}

}
6 changes: 6 additions & 0 deletions Syncrop/SyncropDaemon/src/settings/SettingsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ public enum Options{

HOST("Host",String.class,"getHost","setHost",TYPE_ADVANCED),
PORT("Port",int.class,"getPort","setPort",TYPE_ADVANCED),

TRUST_STORE_FILE("Host",String.class,"getTrustStoreFile","setTrustStoreFile",TYPE_ADVANCED),
TRUST_STORE_PASSWORD("Trust Store Password",String.class,"getTrustStorePassword","setTrustStorePassword",TYPE_ADVANCED),
SSL_CONNECTION("Host",boolean.class,"isSSLConnection","setSSLConnection",TYPE_ADVANCED),
SSL_PORT("SSL Port",int.class,"getSSLPort","setSSLPort",TYPE_ADVANCED),

LOG_LEVEL("Log Level",int.class,"getLogLevel","setLogLevel",TYPE_ADVANCED),
MAX_ACCOUNT_SIZE("Max Account Size (MB)",double.class,"getMaxAccountSize","setMaxAccountSize",TYPE_ADVANCED),
MULTIPLE_INSTANCES("Multiple Instances",boolean.class,"allowMultipleInstances","setMultipleInstances",TYPE_ADVANCED),
Expand Down

0 comments on commit 37690b4

Please sign in to comment.