title: python and ldap via SSL
body: <p>I try to query an Active Directory Server with python which works fine. But now I don't want to send my credentials unencrypted on the wire, so I'd like to use LDAPs. 
  Is there an easy way to do this? All I found till now was that I had to add this option: </p>
  
  <pre><code>l.set_option(ldap.OPT_X_TLS_CACERTFILE,'/path/to/my/Ca.pem')
  </code></pre>
  
  <p>But I actually don't want to get the CA cert or a correct cert and verify that as well. Sure, from a security perspective I should verify that my communication partner is the correct one, but I don't care on my internal network and want this just easier to handle. 
  If I just change the LDAP URL from ldap to ldaps I get this error: </p>
  
  <pre><code>Traceback (most recent call last):
    File "./ldap-to-sql.py", line 21, in &lt;module&gt;
      bind = l.simple_bind_s(USERNAME, PASS)
    File "/usr/local/lib/python2.7/site-packages/ldap/ldapobject.py", line 214, in simple_bind_s
      msgid = self.simple_bind(who,cred,serverctrls,clientctrls)
    File "/usr/local/lib/python2.7/site-packages/ldap/ldapobject.py", line 208, in simple_bind
      return self._ldap_call(self._l.simple_bind,who,cred,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
    File "/usr/local/lib/python2.7/site-packages/ldap/ldapobject.py", line 106, in _ldap_call
      result = func(*args,**kwargs)
  ldap.SERVER_DOWN: {'info': 'SSLHandshake() failed: misc. bad certificate (-9825)', 'desc': "Can't contact LDAP server"}
  </code></pre>