Raise an explicit BackendError on TLS failures
This change is a port of an existing pull request for ldappool [1] It simply raises a more appropriate error / stacktrace if unable to bind. [1] https://github.com/mozilla-services/ldappool/pull/3 Change-Id: I3a17160a76122a1e4d05112fc86e346dea5dd88b
This commit is contained in:
parent
feed0a08c8
commit
61695772c5
|
@ -187,6 +187,12 @@ class ConnectionManager(object):
|
|||
def _bind(self, conn, bind, passwd):
|
||||
# let's bind
|
||||
if self.use_tls:
|
||||
try:
|
||||
conn.start_tls_s()
|
||||
except Exception:
|
||||
raise BackendError('Could not activate TLS on established '
|
||||
'connection with %s' % self.uri,
|
||||
backend=conn)
|
||||
conn.start_tls_s()
|
||||
|
||||
if bind is not None:
|
||||
|
|
Loading…
Reference in New Issue