-
Notifications
You must be signed in to change notification settings - Fork 126
[doc] Explain TLS/SSL gotchas #55
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
Comments
Do we want to actually track this in code, issue a warning for one release, then make it a hard error? |
It's a bit tricky. The cert settings can be changed globally
|
See python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
See python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
See python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
See python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
See python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
See python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
See python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
See python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
See python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
See python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
See python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
See python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
Documenting it is fine, or at least a good first step. We don't need to hand-hold the users (though it would be nice if we did). |
Anyway, I don't think 3.0.0 beta needs to wait for this, as it's not a regression from either python-ldap or pyldap. |
See python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
See python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
See python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
See python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
See python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
Without OPT_X_TLS_NEWCTX, most settings TLS settings are not applied. See python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
Without OPT_X_TLS_NEWCTX, most settings TLS settings are not applied. See python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
sometimes setting OPT_X_TLS_NEWCTX throws a ValueError, but it still connects successfully This is a problem for reconnecting ldap object because it doesn't catch the value error when settings OPT_X_TLS_NEWCTX |
@encukou would it be better if all options were set at once using a namedtuple? ldap.initialize(uri=x, options=ldap.Options(referrals=0, tls_certfile=..., )) and global and then OPT_X_TLS_NEWCTX would just be sent last if |
I'm only familiar with the OpenSSL and NSS backends. I know for a fact that the OpenSSL backend throws a ValueError with |
Would it be possible to throw a FileNotFoundError instead? |
No, OpenLDAP libldap does not return additional information. python-ldap just gets a generic error code.
|
@tiran I've raised an issue re the generic error code with openldap https://www.openldap.org/its/index.cgi/Incoming?id=9157 |
|
@tiran ah yes I misunderstood that issue thread |
Looks like I'm not the only person that got confused by OpenLDAP's documentation. :) I started https://www.openldap.org/its/index.cgi/Incoming?id=8805 because I misunderstood how NEWCTX works. |
See: python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
See: python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
See: python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com>
See: python-ldap#55 Signed-off-by: Christian Heimes <cheimes@redhat.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
In OpenLDAP 2.6 (due for release in September) the fix for ITS#9157 will be released. The error message from the TLS library will be saved in |
Uh oh!
There was an error while loading. Please reload this page.
TLS/SSL and X.509 are tricky. OpenLDAP adds some additional gotchas to the stack. We should document them so users don't run into issues like pyldap/pyldap#53
start_tls_s()
requires protocol version 3. It does not work with protocol version 2.set_option(OPT_X_TLS_*, ...)
calls require a finalset_option(ldap.OPT_X_TLS_NEWCTX, 0)
call to submit all previousset_option()
calls. WithoutOPT_X_TLS_NEWCTX
, settings are effectively ignored.OPT_X_TLS_NEWCTX
is requiredOPT_X_TLS_*
are useless.The text was updated successfully, but these errors were encountered: