From 9461b31edd6d60207a7cf2a050f6f7028430e803 Mon Sep 17 00:00:00 2001 From: Veebs Date: Sun, 13 Nov 2011 14:42:59 +1100 Subject: [PATCH] Added checks to make sure expected system properties are present. --- .../websocketx/sslserver/WebSocketSslServer.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/org/jboss/netty/example/http/websocketx/sslserver/WebSocketSslServer.java b/src/main/java/org/jboss/netty/example/http/websocketx/sslserver/WebSocketSslServer.java index 3fe4a60c5e..9915e7c35e 100644 --- a/src/main/java/org/jboss/netty/example/http/websocketx/sslserver/WebSocketSslServer.java +++ b/src/main/java/org/jboss/netty/example/http/websocketx/sslserver/WebSocketSslServer.java @@ -59,6 +59,18 @@ public class WebSocketSslServer { Logger.getLogger("").addHandler(ch); Logger.getLogger("").setLevel(Level.FINE); + String keyStoreFilePath = System.getProperty("keystore.file.path"); + if (keyStoreFilePath == null || keyStoreFilePath.isEmpty()) { + System.out.println("ERROR: System property keystore.file.path not set. Exiting now!"); + System.exit(1); + } + + String keyStoreFilePassword = System.getProperty("keystore.file.password"); + if (keyStoreFilePassword == null || keyStoreFilePassword.isEmpty()) { + System.out.println("ERROR: System property keystore.file.password not set. Exiting now!"); + System.exit(1); + } + // Configure the server. ServerBootstrap bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory( Executors.newCachedThreadPool(), Executors.newCachedThreadPool()));