[GH-ISSUE #1259] LDAP using TLS not possible with current control panel settings #1021

Closed
opened 2026-02-27 11:14:47 +03:00 by kerem · 2 comments
Owner

Originally created by @psycotic2017 on GitHub (Oct 2, 2017).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1259

Impacted versions

  • Modoboa: 1.9.0
  • installer used: No
  • Webserver: Apache

Current behavior

Even though the control panel suggests otherwise there is no option to use LDAP with TLS. Selecting 'Yes' on the 'Use a secured connection' setting only seems to create a LDAP URL for SSL (ldaps://) even if the port number is 389.

Selecting 'No' on the 'Use a secured connection' setting and putting 'AUTH_LDAP_START_TLS = True' in settings.py enables communication with LDAP over TLS

Expected behavior

Selecting 'Yes' on the 'Use a secured connection' setting and leaving the port number at 389 suggests to me that TLS would be used

Originally created by @psycotic2017 on GitHub (Oct 2, 2017). Original GitHub issue: https://github.com/modoboa/modoboa/issues/1259 # Impacted versions * Modoboa: 1.9.0 * installer used: No * Webserver: Apache # Current behavior Even though the control panel suggests otherwise there is no option to use LDAP with TLS. Selecting 'Yes' on the 'Use a secured connection' setting only seems to create a LDAP URL for SSL (ldaps://) even if the port number is 389. Selecting 'No' on the 'Use a secured connection' setting and putting 'AUTH_LDAP_START_TLS = True' in settings.py enables communication with LDAP over TLS # Expected behavior Selecting 'Yes' on the 'Use a secured connection' setting and leaving the port number at 389 suggests to me that TLS would be used
kerem 2026-02-27 11:14:47 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@tonioo commented on GitHub (Oct 6, 2017):

@psycotic2017 And what happens if you change the port?

<!-- gh-comment-id:334803588 --> @tonioo commented on GitHub (Oct 6, 2017): @psycotic2017 And what happens if you change the port?
Author
Owner

@psycotic2017 commented on GitHub (Oct 7, 2017):

@tonioo Changing the port number makes no difference, as far as I can tell.

Looking at the code in modoboa/core/app_settings.py (and I'm no python expert at all) at line 421:
ldap_uri = "ldaps://" if values["ldap_secured"] else "ldap://"

This piece of code seems to set the ldap uri independent of the port number.

Personally I think the ldap secured setting should have 3 values and not 2 as it has at present.
Rather than off or on it should be off, ssl or tls.
The ssl setting would set the ldaps:// uri as it does already, the tls setting would keep the ldap:// uri but set AUTH_LDAP_START_TLS = True

<!-- gh-comment-id:334911494 --> @psycotic2017 commented on GitHub (Oct 7, 2017): @tonioo Changing the port number makes no difference, as far as I can tell. Looking at the code in modoboa/core/app_settings.py (and I'm no python expert at all) at line 421: `ldap_uri = "ldaps://" if values["ldap_secured"] else "ldap://"` This piece of code seems to set the ldap uri independent of the port number. Personally I think the ldap secured setting should have 3 values and not 2 as it has at present. Rather than off or on it should be off, ssl or tls. The ssl setting would set the `ldaps://` uri as it does already, the tls setting would keep the `ldap://` uri but set `AUTH_LDAP_START_TLS = True`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1021
No description provided.