Skip to content
Snippets Groups Projects
Commit fa4125ea authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Add an option to disable LDAP encryption

We had one use case where the LDAP server didn't support encryption,
so support that too.
parent 5591cf5f
Branches
Tags v0.3.3
No related merge requests found
Pipeline #194270 passed
# v0.3.3
* config: ldap.encryption gained an option "plain" for disabling encryption
......@@ -25,8 +25,8 @@ class Configuration implements ConfigurationInterface
->scalarNode('username')->end()
->scalarNode('password')->end()
->enumNode('encryption')
->info('simple_tls uses port 636 and is sometimes referred to as "SSL", start_tls uses port 389 and is sometimes referred to as "TLS"')
->values(['start_tls', 'simple_tls'])
->info('simple_tls uses port 636 and is sometimes referred to as "SSL", start_tls uses port 389 and is sometimes referred to as "TLS", plain means none')
->values(['start_tls', 'simple_tls', 'plain'])
->defaultValue('start_tls')
->end()
->end();
......
......@@ -96,10 +96,10 @@ class LDAPApi implements LoggerAwareInterface, ServiceSubscriberInterface
];
$encryption = $config['ldap']['encryption'];
assert(in_array($encryption, ['start_tls', 'simple_tls'], true));
assert(in_array($encryption, ['start_tls', 'simple_tls', 'plain'], true));
$this->providerConfig['use_tls'] = ($encryption === 'start_tls');
$this->providerConfig['use_ssl'] = ($encryption === 'simple_tls');
$this->providerConfig['port'] = ($encryption === 'start_tls') ? 389 : 636;
$this->providerConfig['port'] = ($encryption === 'start_tls' || $encryption === 'plain') ? 389 : 636;
}
public function checkConnection()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment