proxy.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:privacyidea-ldap-proxy 作者: NetKnights-GmbH 项目源码 文件源码
def connect_service_account(self):
        """
        Make a new connection to the LDAP backend server using the credentials of the service account
        :return: A Deferred that fires a `LDAPClient` instance
        """
        client = yield connectToLDAPEndpoint(reactor, self.proxied_endpoint_string, LDAPClient)
        if self.use_tls:
            client = yield client.startTLS()
        try:
            yield client.bind(self.service_account_dn, self.service_account_password)
        except ldaperrors.LDAPException, e:
            # Call unbind() here if an exception occurs: Otherwise, Twisted will keep the file open
            # and slowly run out of open files.
            yield client.unbind()
            raise e
        defer.returnValue(client)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号