-
Notifications
You must be signed in to change notification settings - Fork 126
Support OPT_X_TLS_PEERCERT #427
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
Conversation
Due to a bug in OpenLDAP, LDAP_OPT_X_TLS_PEERCERT leaks memory: https://bugs.openldap.org/show_bug.cgi?id=9696 |
f5d29ea
to
9863bb7
Compare
Tests/t_ldapobject.py
Outdated
server_pem = f.read() | ||
# remove text | ||
begin = server_pem.find("-----BEGIN CERTIFICATE-----") | ||
server_pem = server_pem[begin:-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: Is removing the final character important? In our case itdoesn't really matter, but if the file doesn't end with a newline, the exception you get here is a bit obscure.
server_pem = server_pem[begin:-1] | |
server_pem = server_pem[begin:] |
Co-authored-by: Thomas Grainger <tagrain@gmail.com> Signed-off-by: Christian Heimes <cheimes@redhat.com>
@@ -421,6 +428,33 @@ def test_multiple_starttls(self): | |||
l.simple_bind_s(self.server.root_dn, self.server.root_pw) | |||
self.assertEqual(l.whoami_s(), 'dn:' + self.server.root_dn) | |||
|
|||
@requires_tls() | |||
@unittest.skipUnless( | |||
hasattr(ldap, "OPT_X_TLS_PEERCERT"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like you still need to register this in Lib/ldap/constants.py
to get the tests enabled?
Already done as part of #458 |
Replaces PR #401