Package: python3-ldap

I am using Debian 11.
Openldap : 2.4.57+dfsg-3+deb11u1
python3-ldap : 3.2.0-4+b3
python3-ldap3: 2.8.1-1
TLS - 1.3
Openssl - 1.1.1n-0+deb11u3

I am try to set a new connect and then import files using below commands:

ldapcon = ldap.initialize('ldap://localhost')
ldapcon.set_option(ldap.OPT_PROTOCOL_VERSION, ldap.VERSION3)
ldapcon.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER)
ldapcon.set_option(ldap.OPT_X_TLS_NEWCTX, 0)


dn_to_add = 'cn=test.user,ou=people,dc=framework,dc=protegrity,dc=com'

modlist_to_add = [('uid', [b'test.user']), ('objectclass',
[b'inetOrgPerson', b'posixAccount', b'top']), ('uidnumber', [b'1003']),
('gidnumber', [b'100']), ('homedirectory', [b'/home/test.user']),
('userpassword', [b'qwer1234']), ('givenname', [b'test']), ('sn',
[b'user']), ('displayname', [b'test user']), ('loginshell',
[b'/usr/local/sbin/manager']), ('cn', [b'test.user']), ('description',
[b'testing']), ('pwdreset', [b'TRUE'])]

*********
But when I run this - ldapcon.add_s(dn_to_add, modlist_to_add)
The slapd service crashes and I get below error

 LDAP Failure: {'desc': "Can't contact LDAP server}
ldap.CONFIDENTIALITY_REQUIRED: {'desc': 'Confidentiality required', 'info':
'TLS confidentiality required'}

Can u guys help me here as in what am I missing on and why the ldap is
crashing... it seems to be an issue with python3-ldap as I am able to run
the below commands without any issues:

 /usr/bin/ldapsearch -x -s base -ZZ -H `conf-get-value -k LDAP_URI` -D
`conf-get-value -k LDAP_BINDDN` -w `conf-get-value -k LDAP_BINDPW` -b
`conf-get-value -k LDAP_BASEDN`

Also, When I was using buster and the relavant packages to to buster and
python3.7 the same code worked absolutely fine.

Can you guys check and help me here ?

Regards,

Shaheena K

Reply via email to