When using LDAPS, check if the Host field has hostnames with ports and use the value from Port field if not.

This commit is contained in:
ignasr 2019-04-12 08:57:52 +02:00
parent 9b1f49413d
commit 12ee9580a9
1 changed files with 3 additions and 0 deletions

View File

@ -1185,6 +1185,9 @@ class LdapConnection implements Selectable, Inspectable
$ldapUrls = explode(' ', $hostname);
if (count($ldapUrls) > 1) {
foreach ($ldapUrls as & $uri) {
if (preg_match('/:\d+$/', $uri) === 0) {
$uri = $uri . ':' . $this->port;
}
if (strpos($uri, '://') === false) {
$uri = 'ldaps://' . $uri;
}