Implement SSLGuacamoleSocket. Add guacd-ssl parameter. Modify guacamole-auth-mysql and simple auth to support it.

This commit is contained in:
Michael Jumper
2013-07-23 00:52:49 -07:00
parent ac8222430c
commit 3c72eaaf32
4 changed files with 196 additions and 6 deletions

View File

@@ -42,6 +42,7 @@ import java.util.List;
import net.sourceforge.guacamole.GuacamoleException;
import net.sourceforge.guacamole.net.GuacamoleSocket;
import net.sourceforge.guacamole.net.InetGuacamoleSocket;
import net.sourceforge.guacamole.net.SSLGuacamoleSocket;
import net.sourceforge.guacamole.net.auth.AbstractConnection;
import net.sourceforge.guacamole.net.auth.ConnectionRecord;
import net.sourceforge.guacamole.properties.GuacamoleProperties;
@@ -96,10 +97,17 @@ public class SimpleConnection extends AbstractConnection {
String hostname = GuacamoleProperties.getProperty(GuacamoleProperties.GUACD_HOSTNAME);
int port = GuacamoleProperties.getProperty(GuacamoleProperties.GUACD_PORT);
// If guacd requires SSL, use it
if (GuacamoleProperties.getProperty(GuacamoleProperties.GUACD_SSL, false))
return new ConfiguredGuacamoleSocket(
new SSLGuacamoleSocket(hostname, port),
config, info
);
// Return connected socket
return new ConfiguredGuacamoleSocket(
new InetGuacamoleSocket(hostname, port),
config, info
new InetGuacamoleSocket(hostname, port),
config, info
);
}

View File

@@ -84,6 +84,16 @@ public class GuacamoleProperties {
};
/**
* Whether guacd requires SSL/TLS on connections.
*/
public static final BooleanGuacamoleProperty GUACD_SSL = new BooleanGuacamoleProperty() {
@Override
public String getName() { return "guacd-ssl"; }
};
/**
* All properties read from guacamole.properties when this class was first
* used.