Add support for LDAPS

This commit is contained in:
Maxime Dor
2017-06-27 00:16:21 +02:00
parent c468644fc6
commit 06be639c30
3 changed files with 12 additions and 2 deletions

View File

@@ -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
}

View File

@@ -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())