回答此问题可获得 20 贡献值,回答如果被采纳可获得 50 分。
<p>我有个剧本:</p>
<pre><code>ldapsearch -xLL -h 10.4.113.46 -D 'E900000@corp.privatedev' -W -b 'dc=corp,dc=privatedev' '(cn=lc_proxy_pentest)'
</code></pre>
<p>它运行良好。在</p>
<p>我用python编程进行同样的查询:</p>
^{pr2}$
<p>错误显示:</p>
<pre><code>Traceback (most recent call last): File "<input>", line 1, in <module>
File "C:\Users\E900000\Python\lib\site-packages\ldap3\core\connection.py", line 278, in __init__
self.bind(read_server_info=True)
File "C:\Users\E900000\Python\lib\site-packages\ldap3\core\connection.py", line 427, in bind
response = self.post_send_single_response(self.send('bindRequest', request, controls))
File "C:\Users\E900000\Python\lib\site-packages\ldap3\strategy\sync.py", line 122, in post_send_single_response
responses, result = self.get_response(message_id)
File "C:\Users\E900000\Python\lib\site-packages\ldap3\strategy\base.py", line 298, in get_response
responses = self._get_response(message_id)
File "C:\Users\E900000\Python\lib\site-packages\ldap3\strategy\sync.py", line 168, in _get_response
dict_response = self.decode_response(ldap_resp)
File "C:\Users\E900000\Python\lib\site-packages\ldap3\strategy\base.py", line 403, in decode_response
result = bind_response_to_dict(component)
File "C:\Users\E900000\Python\lib\site-packages\ldap3\operation\bind.py", line 119, in bind_response_to_dict
'saslCreds': bytes(response['serverSaslCreds']) if response['serverSaslCreds'] is not None else None}
File "C:\Users\E900000\Python\lib\site-packages\pyasn1\type\univ.py", line 984, in __bytes__
return bytes(self._value) TypeError: cannot convert 'NoValue' object to bytes
</code></pre>
<p>如果我编程</p>
<pre><code>server = Server('10.4.113.46')
conn = Connection(server)
conn.bind()
</code></pre>
<p>第三行带来了同样的错误。在</p>
<p>怎么了?在</p>