diff --git a/app/src/main/java/lightcontainer/domains/client/ClientHandler.java b/app/src/main/java/lightcontainer/domains/client/ClientHandler.java index 15f1ed5..6a3faa3 100644 --- a/app/src/main/java/lightcontainer/domains/client/ClientHandler.java +++ b/app/src/main/java/lightcontainer/domains/client/ClientHandler.java @@ -116,7 +116,9 @@ public class ClientHandler implements Runnable, AutoCloseable { } else { authentication(ruleResult); } - } catch (IOException ignore) { } + } catch (IOException ignore) { + ignore.printStackTrace(); + } } } diff --git a/app/src/main/java/lightcontainer/domains/server/UnicastServerListener.java b/app/src/main/java/lightcontainer/domains/server/UnicastServerListener.java index 5970d61..a12b5d0 100644 --- a/app/src/main/java/lightcontainer/domains/server/UnicastServerListener.java +++ b/app/src/main/java/lightcontainer/domains/server/UnicastServerListener.java @@ -5,6 +5,8 @@ import lightcontainer.interfaces.ProtocolRepository; import lightcontainer.interfaces.UnicastCHR; import lightcontainer.repository.FileFrontEnd; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLServerSocketFactory; import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; @@ -31,17 +33,17 @@ public class UnicastServerListener implements Runnable { /** * Initializes the server and starts it on the previously selected port. * - * @since 1.0 - * - * @see Thread#start() - * @see ClientHandler + * @see Thread#start() + * @see ClientHandler + * @since 1.0 */ @Override public void run() { try { // Allow looping in the loop and create a socket server + SSLServerSocketFactory sslserversocketfactory = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); + this.server = sslserversocketfactory.createServerSocket(this.server_port); this.server_run = true; - this.server = new ServerSocket(this.server_port); while (this.server_run) { // Accepting connection requests (blocking) Socket client = this.server.accept(); @@ -61,14 +63,15 @@ public class UnicastServerListener implements Runnable { /** * Stops the server and terminates the new connection. * - * @since 1.0 + * @since 1.0 */ public void stop() { if (this.server_run) { try { this.server_run = false; this.server.close(); - } catch (IOException ignored) { } + } catch (IOException ignored) { + } } } diff --git a/app/src/main/java/lightcontainer/utils/AES_GCM.java b/app/src/main/java/lightcontainer/utils/AES_GCM.java index 5aeed9d..2a9c832 100644 --- a/app/src/main/java/lightcontainer/utils/AES_GCM.java +++ b/app/src/main/java/lightcontainer/utils/AES_GCM.java @@ -18,7 +18,7 @@ public class AES_GCM { public static void main(String[] args) throws Exception { // Text pour test : - String plainText = "salut fils de pute"; + String plainText = "salut fils de pute";//TODO enlever le text chelou de Jérémi (ce fou là) String IV = generateIV(); String key = generateSecretKey(); diff --git a/ffe.labo.swilabus.com.p12 b/ffe.labo.swilabus.com.p12 new file mode 100644 index 0000000..98ca601 Binary files /dev/null and b/ffe.labo.swilabus.com.p12 differ