private GuacamoleProxyConfiguration getProxyConfiguration(Entry connectionEntry)
            throws GuacamoleException {
        
        try {
                    
            // Get default proxy configuration values
            GuacamoleProxyConfiguration proxyConfig = LocalEnvironment.getInstance().getDefaultGuacamoleProxyConfiguration();
            String proxyHostname = proxyConfig.getHostname();
            int proxyPort = proxyConfig.getPort();
            EncryptionMethod proxyEncryption = proxyConfig.getEncryptionMethod();

            // Get the proxy hostname
            Attribute proxyHostAttr = connectionEntry.get(LDAP_ATTRIBUTE_PROXY_HOSTNAME);
            if (proxyHostAttr != null && proxyHostAttr.size() > 0)
                proxyHostname = proxyHostAttr.getString();

            // Get the proxy port
            Attribute proxyPortAttr = connectionEntry.get(LDAP_ATTRIBUTE_PROXY_PORT);
            if (proxyPortAttr != null && proxyPortAttr.size() > 0)
                proxyPort = Integer.parseInt(proxyPortAttr.getString());

            // Get the proxy encryption method
            Attribute proxyEncryptionAttr = connectionEntry.get(LDAP_ATTRIBUTE_PROXY_ENCRYPTION);
            if (proxyEncryptionAttr != null && proxyEncryptionAttr.size() > 0) {
                try {
                    proxyEncryption = EncryptionMethod.valueOf(proxyEncryptionAttr.getString());
                }
                catch (IllegalArgumentException e) {
                    throw new GuacamoleServerException("Unknown encryption method specified, value must be either \"NONE\" or \"SSL\".", e);
                }
            }

            // Return a new proxy configuration
            return new GuacamoleProxyConfiguration(proxyHostname, proxyPort, proxyEncryption);
        }
        catch (LdapInvalidAttributeValueException e) {
            logger.error("Invalid value in proxy configuration: {}", e.getMessage());
            logger.debug("LDAP exception fetching proxy attribute value.", e);
            throw new GuacamoleServerException("Invalid LDAP value in proxy configuration.", e);
        }
    }
Given an LDAP entry that stores a GuacamoleConfiguration, generate a
GuacamoleProxyConfiguration that tells the client how to connect to guacd.
If the proxy configuration values are not found in the LDAP entry the
defaults from the environment are used. If errors occur while trying to
ready or parse values from the LDAP entry a GuacamoleException is thrown.

@param connectionEntry
    The LDAP entry that should be checked for proxy configuration values.

@return
    The GuacamoleProxyConfiguration that contains information on how
    to contact guacd for the given Guacamole connection configuration.

@throws GuacamoleException 
    If errors occur trying to parse LDAP values from the entry.
extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/connection/ConnectionService.java