'Returns our cached LDAPObject, which may or may not be bound.'

def _get_connection(self):

    if (self._connection is None):
        uri = self.settings.SERVER_URI
        if callable(uri):
            uri = uri()
        self._connection = self.backend.ldap.initialize(uri)
        for (opt, value) in self.settings.CONNECTION_OPTIONS.items():
            self._connection.set_option(opt, value)
        if self.settings.START_TLS:
            logger.debug('Initiating    TLS')
            self._connection.start_tls_s()
    return self._connection
