Skip to content

Commit

Permalink
Rename LDAP_TIMEOUT to LDAP_CONNECT_TIMEOUT and actually use it (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbw authored and rroemhild committed Jun 13, 2018
1 parent 65ba44d commit 2d4ea52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Your configuration should be declared within your Flask config. Sample configura
LDAP_PORT = 389
LDAP_BINDDN = 'cn=admin,dc=example,dc=com'
LDAP_SECRET = 'forty-two'
LDAP_TIMEOUT = 10
LDAP_CONNECT_TIMEOUT = 10 # Honored when the TCP connection is being established
LDAP_USE_TLS = True # default
LDAP_REQUIRE_CERT = ssl.CERT_NONE # default: CERT_REQUIRED
LDAP_TLS_VERSION = ssl.PROTOCOL_TLSv1_2 # default: PROTOCOL_TLSv1
Expand Down
3 changes: 2 additions & 1 deletion flask_ldapconn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def init_app(self, app):
app.config.setdefault('LDAP_PORT', 389)
app.config.setdefault('LDAP_BINDDN', None)
app.config.setdefault('LDAP_SECRET', None)
app.config.setdefault('LDAP_TIMEOUT', 10)
app.config.setdefault('LDAP_CONNECT_TIMEOUT', 10)
app.config.setdefault('LDAP_READ_ONLY', False)
app.config.setdefault('LDAP_VALID_NAMES', None)
app.config.setdefault('LDAP_PRIVATE_KEY_PASSWORD', None)
Expand Down Expand Up @@ -74,6 +74,7 @@ def init_app(self, app):
host=app.config['LDAP_SERVER'],
port=app.config['LDAP_PORT'],
use_ssl=app.config['LDAP_USE_SSL'],
connect_timeout=app.config['LDAP_CONNECT_TIMEOUT'],
tls=self.tls,
get_info=ALL
)
Expand Down

0 comments on commit 2d4ea52

Please sign in to comment.