[Tickets #1149] NEW: SSL/TLS

bugs at bugs.horde.org bugs at bugs.horde.org
Thu Jan 13 07:47:43 PST 2005


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=1149
-----------------------------------------------------------------------
 Ticket     | 1149
 Created By | ldillon at sk-tech.com
 Summary    | SSL/TLS
 Queue      | Turba
 Version    | HEAD
 State      | New
 Priority   | 1. Low
 Type       | Enhancement
 Owners     | 
-----------------------------------------------------------------------


ldillon at sk-tech.com (2005-01-13 07:47) wrote:

Added opton for SSL/TLS connection.

In config/sources.php, for all ldap sources that need/want an ssl
connection, add the following option in 'params':

'usetls' => true

The following patch enables use of ssl/tls:

--- /tmp/ldap.php.org	2005-01-13 08:37:13.000000000 -0600
+++ ldap.php	2005-01-13 09:44:17.942846190 -0600
@@ -68,6 +68,14 @@
             @ldap_set_option($this->_ds, LDAP_OPT_PROTOCOL_VERSION,
$this->_params['version']);
         }
 
+	// Connect with SSL/TLS if enabled
+	if (isset($this->_params['usetls']) &&
+	    $this->_params['usetls'] === true) {
+	    if (!@ldap_start_tls($this->_ds)) {
+		return PEAR::raiseError(sprintf(_("Ldap_start_tls failed: (%s) %s"),
ldap_errno($this->_ds), ldap_error($this->_ds)));
+	    }
+	}
+
         if (isset($this->_params['bind_dn']) &&
             isset($this->_params['bind_password'])) {
             if (!@ldap_bind($this->_ds, $this->_params['bind_dn'],
$this->_params['bind_password'])) {


This will use tls if it is set, or ignore it if not.






More information about the bugs mailing list