forked from ungleich-public/ungleich-user
ldap3 does not verify TLS certificates by default, and the app never configured it to. ldaps:// and StartTLS were encrypted but accepted any certificate, so anyone able to intercept LDAP traffic could pose as the server and collect the admin password and every password used to log in. All LDAP servers now use VerifiedTls, which leaves verification to Python's ssl module: certificate chain and hostname, IP literals included (ldap3's own matcher cannot handle IPv6 literals). It also sends SNI and requires TLS 1.2 or newer. LDAP_CA_FILE adds a CA bundle for a private CA. LDAP_TLS_VERIFY=False turns verification off, with a logged warning. A failed StartTLS now always raises instead of continuing in plaintext. New tests against the dev LDAP cover ldaps, StartTLS and ldaps over an IPv6 literal with the CA (and check the socket is encrypted), plain LDAP over IPv6, rejection of an untrusted certificate (ldaps and StartTLS), rejection of a hostname mismatch, and the opt-out. |
||
|---|---|---|
| .. | ||
| management | ||
| migrations | ||
| static | ||
| templates | ||
| tests | ||
| __init__.py | ||
| backends.py | ||
| forms.py | ||
| health.py | ||
| models.py | ||
| settings.py | ||
| ungleich_ldap.py | ||
| urls.py | ||
| views.py | ||
| wsgi.py | ||