Add support for LDAPS
This commit is contained in:
@@ -32,7 +32,8 @@ class LdapConfig implements InitializingBean {
|
||||
|
||||
private Logger log = LoggerFactory.getLogger(LdapConfig.class)
|
||||
|
||||
private boolean enabled;
|
||||
private boolean enabled
|
||||
private boolean tls
|
||||
private String host
|
||||
private int port
|
||||
private String baseDn
|
||||
@@ -50,6 +51,14 @@ class LdapConfig implements InitializingBean {
|
||||
this.enabled = enabled
|
||||
}
|
||||
|
||||
boolean getTls() {
|
||||
return tls
|
||||
}
|
||||
|
||||
void setTls(boolean tls) {
|
||||
this.tls = tls
|
||||
}
|
||||
|
||||
String getHost() {
|
||||
return host
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ class LdapProvider implements IThreePidProvider {
|
||||
Optional<?> find(SingleLookupRequest request) {
|
||||
log.info("Performing LDAP lookup ${request.getThreePid()} of type ${request.getType()}")
|
||||
|
||||
LdapConnection conn = new LdapNetworkConnection(ldapCfg.getHost(), ldapCfg.getPort())
|
||||
LdapConnection conn = new LdapNetworkConnection(ldapCfg.getHost(), ldapCfg.getPort(), ldapCfg.getTls())
|
||||
try {
|
||||
conn.bind(ldapCfg.getBindDn(), ldapCfg.getBindPassword())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user