mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 13:41:21 +00:00
GUAC-1101: Use SSL if requested. Use provided client information.
This commit is contained in:
@@ -213,6 +213,35 @@ public abstract class AbstractGuacamoleSocketService implements GuacamoleSocketS
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an unconfigured GuacamoleSocket that is already connected to
|
||||
* guacd as specified in guacamole.properties, using SSL if necessary.
|
||||
*
|
||||
* @return
|
||||
* An unconfigured GuacamoleSocket, already connected to guacd.
|
||||
*
|
||||
* @throws GuacamoleException
|
||||
* If an error occurs while connecting to guacd, or while parsing
|
||||
* guacd-related properties.
|
||||
*/
|
||||
private GuacamoleSocket getUnconfiguredGuacamoleSocket()
|
||||
throws GuacamoleException {
|
||||
|
||||
// Use SSL if requested
|
||||
if (environment.getProperty(Environment.GUACD_SSL, true))
|
||||
return new InetGuacamoleSocket(
|
||||
environment.getRequiredProperty(Environment.GUACD_HOSTNAME),
|
||||
environment.getRequiredProperty(Environment.GUACD_PORT)
|
||||
);
|
||||
|
||||
// Otherwise, just use straight TCP
|
||||
return new InetGuacamoleSocket(
|
||||
environment.getRequiredProperty(Environment.GUACD_HOSTNAME),
|
||||
environment.getRequiredProperty(Environment.GUACD_PORT)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a socket for the given user which connects to the given
|
||||
* connection, which MUST already be acquired via acquire(). The given
|
||||
@@ -261,11 +290,9 @@ public abstract class AbstractGuacamoleSocketService implements GuacamoleSocketS
|
||||
|
||||
// Return newly-reserved connection
|
||||
return new ConfiguredGuacamoleSocket(
|
||||
new InetGuacamoleSocket(
|
||||
environment.getRequiredProperty(Environment.GUACD_HOSTNAME),
|
||||
environment.getRequiredProperty(Environment.GUACD_PORT)
|
||||
),
|
||||
getGuacamoleConfiguration(user, connection)
|
||||
getUnconfiguredGuacamoleSocket(),
|
||||
getGuacamoleConfiguration(user, connection),
|
||||
info
|
||||
) {
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user