Skip to content

Commit bdb4396

Browse files
committed
Added settings for CA certificates for LDAP
1 parent 80d87bd commit bdb4396

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

configuration/ldap/ldap_config.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ def _import_group_type(group_type_name):
4949
# ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER)
5050
LDAP_IGNORE_CERT_ERRORS = environ.get('LDAP_IGNORE_CERT_ERRORS', 'False').lower() == 'true'
5151

52+
# Include this setting if you want to validate the LDAP server certificates against a CA certificate directory on your server
53+
# Note that this is a NetBox-specific setting which sets:
54+
# ldap.set_option(ldap.OPT_X_TLS_CACERTDIR, LDAP_CA_CERT_DIR)
55+
LDAP_CA_CERT_DIR = environ.get('LDAP_CA_CERT_DIR', None)
56+
57+
# Include this setting if you want to validate the LDAP server certificates against your own CA.
58+
# Note that this is a NetBox-specific setting which sets:
59+
# ldap.set_option(ldap.OPT_X_TLS_CACERTFILE, LDAP_CA_CERT_FILE)
60+
LDAP_CA_CERT_FILE = environ.get('LDAP_CA_CERT_FILE', None)
61+
5262
AUTH_LDAP_USER_SEARCH_BASEDN = environ.get('AUTH_LDAP_USER_SEARCH_BASEDN', '')
5363
AUTH_LDAP_USER_SEARCH_ATTR = environ.get('AUTH_LDAP_USER_SEARCH_ATTR', 'sAMAccountName')
5464
AUTH_LDAP_USER_SEARCH = LDAPSearch(

0 commit comments

Comments
 (0)