-
Notifications
You must be signed in to change notification settings - Fork 126
Release 3.4.0 #431
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
Release 3.4.0 #431
Conversation
This should be done at the *start* of a release cycle.
Issue #350 still incorrectly states that you can't do start_tls over ldapi |
There is no meaningful way to do TLS over LDAPI. Either handshake fails or TLS connection cannot be verified. With 389-DS:
With OpenLDAP 2.4.57
With OpenLDAP 2.4.57 and custom LDAP_OPT_HOST_NAME:
|
This is literally something that's tested as a part of the OpenLDAP test suite as I noted in the issue. It's entirely possible to do it with other APIs as well, such as Net::LDAP which doesn't even use the OpenLDAP libraries. Example:
From the slapd log file when this is executed:
So yes, it is possible to do startTLS over ldapi if the client is configured correctly. |
Would you care to explain how to do TLS with cert validation over LDAPI using OpenLDAP client libraries and python-ldap? |
So I realized my initial comment wasn't exactly clear. The OpenLDAP client libraries already support this, and they are tested via the OpenLDAP test suite via the use of the command line tools (ldapwhoami, etc) which make use of the OpenLDAP client libraries. I'll see if I can dig into what's necessary for python-ldap to correctly utilize the libraries. |
@tiran it works fine for me:
Slapd logs:
|
I've expanded my script, still works even after setting demand. I don't believe the second test case will ever succeed, since the OPT_HOST_NAME value must be set to a DNS: value of subjectAltName in the server certificate. I can only speculate that there's an issue with the ldap libraries caused by some type of custom patch that's not present in stock OpenLDAP (which is what I'm testing against), or that some of the values in your test are not what they should be. For example, if the value of self.server.hostname does not match anything in the subjectAltName DNS field of the certificate on the server. For the cert I'm using:
Here's my updated script based off your test suite, which continues to work:
|
The test case fails on both Debian/Ubuntu and on Fedora. We cannot support a feature that we are not able to test and that does not work for majority of our user base. Most of our users are either on Debian-based systems (including Ubuntu) or on Fedora-based systems (including CentOS and RHEL) with OpenLDAP 2.4.57 or older. We also don't have resources to support the full feature set of libldap. python-ldap is an opinionated wrapper that supports a popular subset of OpenLDAP's features. So far there hasn't been any request for TLS over LDAPI except from you. I suggest that you open a feature request for TLS over LDAPI so the issue doesn't get lost. |
@tiran As I've noted multiple times now, there is literally nothing special about this functionality. It's not new, it's been around for years, and it's fully supported by libldap. Not only that, as I've repeatedly demonstrated, it's already fully supported by python-ldap as well. I spent time this morning setting up an centos8 system using the python3-ldap shipped with centos8 for python3.6, and was trivially able to confirm that the ability to do startTLS + ldapi is currently supported with the system libldap shipped in centos8. I spent time this morning also setting up an ubuntu20 system using the python3-ldap shipped with ubuntu20 for python3.8, and was trivially able to confirm that the ability to do startTLS + ldapi is currently supported with the system libldap shipped in Ubuntu20. CentOS8:
Ubuntu20:
As you can see, no issues on either server. Since this was inside a container that had no valid host, I had to set the hostname to the localhost IP, which is in the subjectAltName value of the cert I previously listed. So, again, this clearly works across the board, and the issue being hit with the test suite is specific to the test suite setup. I've no visibility into the cert being used by the test suite or the way in which slapd is configured to run via the test suite, so I can't help further there. But there is zero issue with python-ldap doing startTLS + ldapi. |
the 3 PRs are postponed to the next version. |
I would like to release soon. The following fixes might go in before the release:
After the release:
strlist
functions