Add support for LDAPS
This commit is contained in:
@@ -98,6 +98,7 @@ lookup:
|
||||
|
||||
ldap:
|
||||
enabled: true
|
||||
tls: false
|
||||
host: 'localhost'
|
||||
port: 389
|
||||
bindDn: 'CN=Matrix Identity Server,CN=Users,DC=example,DC=org'
|
||||
|
||||
@@ -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