Merge pull request #3714 from ignasr/fix/ldaps-port-3713
use the correct LDAPS port
(cherry picked from commit 8fc467ca3c
)
Signed-off-by: Johannes Meyer <johannes.meyer@icinga.com>
This commit is contained in:
parent
dd1fd2eb71
commit
991bdcdbec
|
@ -1185,6 +1185,9 @@ class LdapConnection implements Selectable, Inspectable
|
||||||
$ldapUrls = explode(' ', $hostname);
|
$ldapUrls = explode(' ', $hostname);
|
||||||
if (count($ldapUrls) > 1) {
|
if (count($ldapUrls) > 1) {
|
||||||
foreach ($ldapUrls as & $uri) {
|
foreach ($ldapUrls as & $uri) {
|
||||||
|
if (preg_match('/:\d+$/', $uri) === 0) {
|
||||||
|
$uri = $uri . ':' . $this->port;
|
||||||
|
}
|
||||||
if (strpos($uri, '://') === false) {
|
if (strpos($uri, '://') === false) {
|
||||||
$uri = 'ldaps://' . $uri;
|
$uri = 'ldaps://' . $uri;
|
||||||
}
|
}
|
||||||
|
@ -1192,7 +1195,7 @@ class LdapConnection implements Selectable, Inspectable
|
||||||
|
|
||||||
$hostname = implode(' ', $ldapUrls);
|
$hostname = implode(' ', $ldapUrls);
|
||||||
} else {
|
} else {
|
||||||
$hostname = 'ldaps://' . $hostname;
|
$hostname = 'ldaps://' . $hostname . ':' . $this->port;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue