From 890d0b6685b424fb1a8d0a864cda9a3679467c2e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 19 Mar 2018 12:11:59 +0100 Subject: [PATCH] Fix: replace ldaps:// by ssl:// --- htdocs/core/class/ldap.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 20a9b85cf86..29c8adb0aaa 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -738,6 +738,11 @@ class Ldap */ function serverPing($host, $port=389, $timeout=1) { + // Replace ldaps:// by ssl:// + if (preg_match('/^ldaps/',$host)) { + preg_match('/^ldaps:\/\/([^\/]+)\/?$/', $host, $regs); + $host = 'ssl://'.$regs[1]; + } $op = @fsockopen($host, $port, $errno, $errstr, $timeout); if (!$op) return false; //DC is N/A else {