Skip to content

Commit

Permalink
add default LDAPS port
Browse files Browse the repository at this point in the history
  • Loading branch information
primetheus authored Sep 18, 2023
1 parent 041ba06 commit ce94cf1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions githubapp/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ class LDAPClient:
def __init__(self):
# Read settings from the config file and store them as constants
self.LDAP_SERVER_HOST = os.environ["LDAP_SERVER_HOST"]
if "LDAP_SERVER_PORT" in os.environ:
self.LDAP_SERVER_PORT = os.environ["LDAP_SERVER_PORT"]
else
self.LDAP_SERVER_PORT = 389
self.LDAP_BASE_DN = os.environ["LDAP_BASE_DN"]
self.LDAP_USER_BASE_DN = os.environ["LDAP_USER_BASE_DN"]
self.LDAP_USER_ATTRIBUTE = os.environ["LDAP_USER_ATTRIBUTE"]
Expand Down Expand Up @@ -76,6 +72,13 @@ def __init__(self):
)
else:
self.tls = None
if "LDAP_SERVER_PORT" in os.environ:
self.LDAP_SERVER_PORT = os.environ["LDAP_SERVER_PORT"]
else
if self.LDAP_USE_SSL:
self.LDAP_SERVER_PORT = 636
else:
self.LDAP_SERVER_PORT = 389

self.srv = Server(
host=self.LDAP_SERVER_HOST,
Expand Down

0 comments on commit ce94cf1

Please sign in to comment.