Skip to content

Commit

Permalink
Fixing "ErrorException: ldap_bind(): Unable to bind to server: Protoc…
Browse files Browse the repository at this point in the history
…ol error in ldap.php:40" when using LDAP protocol 3
  • Loading branch information
maltris authored and Thomas Pike committed Aug 9, 2017
1 parent 1b4ae5f commit 1d8461c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ldap.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ private function connect() {
if(!ldap_start_tls($this->conn)) throw new LDAPConnectionFailureException('Could not initiate TLS connection to LDAP server');
}
if(!empty($this->bind_dn)) {
ldap_set_option($this->conn, LDAP_OPT_PROTOCOL_VERSION, 3);
if(!ldap_bind($this->conn, $this->bind_dn, $this->bind_password)) throw new LDAPConnectionFailureException('Could not bind to LDAP server');
}
}
Expand Down

0 comments on commit 1d8461c

Please sign in to comment.