diff --git a/src/Symfony/Component/Ldap/LdapClient.php b/src/Symfony/Component/Ldap/LdapClient.php index 734ff4e906..ebb263d5cf 100644 --- a/src/Symfony/Component/Ldap/LdapClient.php +++ b/src/Symfony/Component/Ldap/LdapClient.php @@ -109,11 +109,11 @@ class LdapClient implements LdapClientInterface $host = 'ldaps://'.$host; } + $this->connection = ldap_connect($host, $this->port); + ldap_set_option($this->connection, LDAP_OPT_PROTOCOL_VERSION, $this->version); ldap_set_option($this->connection, LDAP_OPT_REFERRALS, $this->optReferrals); - $this->connection = ldap_connect($host, $this->port); - if ($this->useStartTls) { ldap_start_tls($this->connection); }