[Samba] Samba python connect using ldaps

Thiago Luiz Parolin tlparolin at gmail.com
Wed Mar 30 14:04:28 UTC 2022


Hi,
I am trying to connect to our samba4 AD DS server (zentyal) using ldaps://
and python code like:

lp = LoadParm()
creds = Credentials()
creds.guess(lp)
creds.set_username('myuser')
creds.set_password('mypass')
url_server = 'ldaps://myserver.mycompany.com:636'
samdb = SamDB(url=url_server,
session_info=system_session(),credentials=creds, lp=lp)

the connection attempt always return:

TLS failed to missing cafile /var/lib/samba/private/tls/ca.pem - with 'tls
verify peer = as_strict_as_possible'
Failed to connect to ldap URL ldaps://myserver.mycompany.com:636r' - LDAP
client internal error: NT_STATUS_INVALID_PARAMETER_MIX
Failed to connect to 'ldaps://myserver.mycompany.com:636' with backend
'ldaps': LDAP client internal error: NT_STATUS_INVALID_PARAMETER_MIX

Using url_server = 'ldap://myserver.mycompany.com' i can successfully
connect. But wouldn't that be unsafe to use?
Sorry if this is a dumb question, i am totally new to the samba world.
If anyone can help i will really apreciate.


More information about the samba mailing list