Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dogtag uses deprecated/removed python-ldap constants #4081

Closed
tiran opened this issue Jul 29, 2022 · 1 comment · Fixed by #4082
Closed

Dogtag uses deprecated/removed python-ldap constants #4081

tiran opened this issue Jul 29, 2022 · 1 comment · Fixed by #4082

Comments

@tiran
Copy link
Member

tiran commented Jul 29, 2022

Dogtag uses deprecated python-ldap constants, which have been removed in latest python-ldap 3.4.2.

def ds_init(self):
ds_hostname = self.mdict['pki_ds_hostname']
if config.str2bool(self.mdict['pki_ds_secure_connection']):
ds_protocol = 'ldaps'
ds_port = self.mdict['pki_ds_ldaps_port']
# ldap.set_option(ldap.OPT_DEBUG_LEVEL, 255)
ldap.set_option(ldap.OPT_X_TLS_DEMAND, True)
ldap.set_option(ldap.OPT_X_TLS, ldap.OPT_X_TLS_DEMAND)
ldap.set_option(ldap.OPT_X_TLS_CACERTFILE,
self.mdict['pki_ds_secure_connection_ca_pem_file'])
ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_DEMAND)
else:
ds_protocol = 'ldap'
ds_port = self.mdict['pki_ds_ldap_port']
self.ds_url = ds_protocol + '://' + ds_hostname + ':' + ds_port

  • OPT_X_TLS is deprecated in OpenLDAP and was removed in python-ldap 3.4.2.
  • OPT_X_TLS_DEMAND is not a valid option key. It is an option value.

I propose to remove both calls. ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_DEMAND) is sufficient to enforce cert validation.

tiran added a commit to tiran/pki that referenced this issue Jul 29, 2022
- `OPT_X_TLS` is deprecated since python-ldap 3.3.0 and was removed in
  3.4.2.
- `OPT_X_TLS_DEMAND` is not a valid option key.

`ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_DEMAND)` is
sufficient to enforce cert validation.

Closes: dogtagpki#4081
@tiran
Copy link
Member Author

tiran commented Jul 29, 2022

Alexander has created downstream RHBZ https://bugzilla.redhat.com/show_bug.cgi?id=2112243 for the issue. It blocks Fedora Rawhide update of python-ldap.

ckelleyRH pushed a commit that referenced this issue Nov 21, 2022
- `OPT_X_TLS` is deprecated since python-ldap 3.3.0 and was removed in
  3.4.2.
- `OPT_X_TLS_DEMAND` is not a valid option key.

`ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_DEMAND)` is
sufficient to enforce cert validation.

Closes: #4081
ckelleyRH pushed a commit that referenced this issue Nov 21, 2022
- `OPT_X_TLS` is deprecated since python-ldap 3.3.0 and was removed in
  3.4.2.
- `OPT_X_TLS_DEMAND` is not a valid option key.

`ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_DEMAND)` is
sufficient to enforce cert validation.

Closes: #4081
ckelleyRH pushed a commit that referenced this issue Nov 21, 2022
- `OPT_X_TLS` is deprecated since python-ldap 3.3.0 and was removed in
  3.4.2.
- `OPT_X_TLS_DEMAND` is not a valid option key.

`ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_DEMAND)` is
sufficient to enforce cert validation.

Closes: #4081
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant