You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to connect to the AD domain, my script hangs at secure=self.encrypt_connections in ms_active_directory/core/ad_domain.py(456). I'm not sure what is going on in the background could have something to do with whatever TLS/etc implementation is in the OS. Is there a way to get more debug info out of the package?
from ms_active_directory import ADDomain
from loguru import logger
import pdb
logger.debug("Startin script")
pdb.set_trace()
example_domain_dns_name = "********"
domain = ADDomain(example_domain_dns_name)
ldap_servers = domain.get_ldap_uris()
kerberos_servers = domain.get_kerberos_uris()
logger.debug("startin discovery")
# re-discover servers in dns and sort them by RTT again at a later time to pick up changes
domain.refresh_ldap_server_discovery()
domain.refresh_kerberos_server_discovery()
logger.debug("creating session")
session = domain.create_session_as_user(
"***************", "*******************"
)
logger.debug("finding data")
user = session.find_user_by_sam_name("**************", ["employeeID"])
group = session.find_group_by_sam_name(
"**************", ["gidNumber"]
)
# users and groups support a generic "get" for any attributes queried
print(user.get("employeeID"))
print(group.get("gidNumber"))
nslookup
The server appears to be able to resolve the domain controllers OK:
The text was updated successfully, but these errors were encountered:
hi @kerryhatcher ! if you set the log level then you can get a bit more detail
conn.open()
logger.debug('Opened connection to AD domain %s: %s', self.domain, conn)
if self.encrypt_connections:
# if we're using LDAPS, don't StartTLS
if not conn.server.ssl:
tls_started = conn.start_tls()
if not tls_started:
raise DomainConnectException('Unable to StartTLS on connection to domain. Please check the '
'server(s) to ensure that they have properly configured certificates.')
logger.debug('Successfully secured connection to AD domain %s', self.domain)
unsure if the underlying python ssl has more logging available (this all builds on that)
can you maybe wireshark it? it's possible that your network is the issue.
a bad MTU size can fragment packets, which makes TLS negotiation hang because the packets keep getting re-transmitted. that's the only scenario where I've seen normal connections work, but TLS hang
Summary
When attempting to connect to the AD domain, my script hangs at
secure=self.encrypt_connections
inms_active_directory/core/ad_domain.py(456)
. I'm not sure what is going on in the background could have something to do with whatever TLS/etc implementation is in the OS. Is there a way to get more debug info out of the package?Env Details
OS: Amazon Linux 2
Server: EC2 t3.small
Installed via Poetry
Ran via:
poetry run python3 ad_demo
Last few lines of python debugger
Higher level debug
Redacted Code
nslookup
The server appears to be able to resolve the domain controllers OK:
The text was updated successfully, but these errors were encountered: