From 2cc8585ecb9741caf985d64f770a3d559e881b35 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 26 Aug 2010 20:44:33 +0000 Subject: [PATCH] small docu about creating ssl (ldaps) or tls connections --- phpgwapi/inc/class.ldap.inc.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/phpgwapi/inc/class.ldap.inc.php b/phpgwapi/inc/class.ldap.inc.php index d297c224b6..52a575a4b5 100644 --- a/phpgwapi/inc/class.ldap.inc.php +++ b/phpgwapi/inc/class.ldap.inc.php @@ -14,6 +14,11 @@ /** * LDAP connection handling + * + * Please note for SSL or TLS connections hostname has to be: + * - SSL: "ldaps://host" + * - TLS: "tls://host" + * Both require certificats installed on the webserver, otherwise the connection will fail! */ class ldap { @@ -105,10 +110,10 @@ class ldap $passwd = $GLOBALS['egw_info']['server']['ldap_root_pw']; } - if (($use_tls = substr($host,0,6) == 'tls://')) - { - $host = parse_url($host,PHP_URL_HOST); - } + if (($use_tls = substr($host,0,6) == 'tls://')) + { + $host = parse_url($host,PHP_URL_HOST); + } // connects to ldap server if(!$this->ds = ldap_connect($host)) { @@ -132,7 +137,7 @@ class ldap { $supportedLDAPVersion = 2; } - if ($use_tls) ldap_start_tls($this->ds); + if ($use_tls) ldap_start_tls($this->ds); if(!isset($this->ldapServerInfo[$host])) {