GUAC-1406: Explicitly call startTLS() if STARTTLS is enabled.

This commit is contained in:
Michael Jumper
2015-12-08 16:08:27 -08:00
parent 8724ef7de7
commit d51a719f2f

View File

@@ -116,12 +116,18 @@ public class LDAPConnectionService {
// Obtain appropriately-configured LDAPConnection instance
LDAPConnection ldapConnection = createLDAPConnection();
// Connect to LDAP server
try {
// Connect to LDAP server
ldapConnection.connect(
confService.getServerHostname(),
confService.getServerPort()
);
// Explicitly start TLS if requested
if (confService.getEncryptionMethod() == EncryptionMethod.STARTTLS)
ldapConnection.startTLS();
}
catch (LDAPException e) {
logger.error("Unable to connect to LDAP server: {}", e.getMessage());