Skip to content

Commit 3fa2c74

Browse files
committed
Silently handle connection timed out during LDAP scan
1 parent da8ef0f commit 3fa2c74

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

nxc/protocols/ldap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import hashlib
44
import hmac
55
import os
6-
from errno import EHOSTUNREACH
6+
from errno import EHOSTUNREACH, ETIMEDOUT
77
from binascii import hexlify
88
from datetime import datetime
99
from re import sub, I
@@ -211,7 +211,7 @@ def create_conn_obj(self):
211211
self.logger.debug(f"{e} on host {self.host}")
212212
return False
213213
except OSError as e:
214-
if e.errno == EHOSTUNREACH:
214+
if e.errno in (EHOSTUNREACH, ETIMEDOUT):
215215
self.logger.info(f"Error connecting to {self.host} - {e}")
216216
return False
217217
else:

0 commit comments

Comments
 (0)