X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2Fserial%2Fserver%2FConnectActionClient.java;h=c56dddd0a727b869f58cec1ce37f6a23c2d2be0f;hp=db06a9f247544cef1d210531d7db45429af1a78b;hb=8468bb79f0fc9c88fa21355509731625732eb10e;hpb=d6ab0dab9051de0ee408dda63db8fdf8e01d221d diff --git a/src/be/nikiroo/utils/serial/server/ConnectActionClient.java b/src/be/nikiroo/utils/serial/server/ConnectActionClient.java index db06a9f..c56dddd 100644 --- a/src/be/nikiroo/utils/serial/server/ConnectActionClient.java +++ b/src/be/nikiroo/utils/serial/server/ConnectActionClient.java @@ -28,9 +28,12 @@ abstract class ConnectActionClient { * * @param s * the socket to bind to + * @param key + * an optional key to encrypt all the communications (if NULL, + * everything will be sent in clear text) */ - public ConnectActionClient(Socket s) { - this(s, Version.getCurrentVersion()); + public ConnectActionClient(Socket s, String key) { + this(s, key, Version.getCurrentVersion()); } /** @@ -41,8 +44,9 @@ abstract class ConnectActionClient { * the host to bind to * @param port * the port to bind to - * @param ssl - * TRUE for an SSL connection, FALSE for plain text + * @param key + * an optional key to encrypt all the communications (if NULL, + * everything will be sent in clear text) * * @throws IOException * in case of I/O error @@ -52,9 +56,9 @@ abstract class ConnectActionClient { * if the port parameter is outside the specified range of valid * port values, which is between 0 and 65535, inclusive */ - public ConnectActionClient(String host, int port, boolean ssl) + public ConnectActionClient(String host, int port, String key) throws IOException { - this(Server.createSocket(host, port, ssl), Version.getCurrentVersion()); + this(new Socket(host, port), key, Version.getCurrentVersion()); } /** @@ -64,8 +68,9 @@ abstract class ConnectActionClient { * the host to bind to * @param port * the port to bind to - * @param ssl - * TRUE for an SSL connection, FALSE for plain text + * @param key + * an optional key to encrypt all the communications (if NULL, + * everything will be sent in clear text) * @param version * the client version * @@ -77,9 +82,9 @@ abstract class ConnectActionClient { * if the port parameter is outside the specified range of valid * port values, which is between 0 and 65535, inclusive */ - public ConnectActionClient(String host, int port, boolean ssl, + public ConnectActionClient(String host, int port, String key, Version version) throws IOException { - this(Server.createSocket(host, port, ssl), version); + this(new Socket(host, port), key, version); } /** @@ -87,11 +92,14 @@ abstract class ConnectActionClient { * * @param s * the socket to bind to + * @param key + * an optional key to encrypt all the communications (if NULL, + * everything will be sent in clear text) * @param version * the client version */ - public ConnectActionClient(Socket s, Version version) { - action = new ConnectAction(s, false, version) { + public ConnectActionClient(Socket s, String key, Version version) { + action = new ConnectAction(s, false, key, version) { @Override protected void action(Version serverVersion) throws Exception { ConnectActionClient.this.action(serverVersion);