-
Notifications
You must be signed in to change notification settings - Fork 39
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
Example of connection to TLS-enabled LDAP server #14
Comments
To solve your immediate problem first, a TLS connection is requested by using the let ldap = LdapConn::new("ldaps://ldap.example.org")?; As for documenting this more explicitly, there are a couple of candidate places. Would you consider the docs for |
Thank you @inejge - that appears to have created a connection, but now the simple_bind which follows it generates a "broken pipe" - this does not happen on the plain ldap:// connection. let ldap = LdapConn::new(LDAP_SERVER)?;
trace!("Binding to LDAP server with {}", LDAP_SERVICE_USER_DN);
ldap.simple_bind(LDAP_SERVICE_USER_DN, LDAP_SERVICE_USER_PW)?.success()?;
trace!("Bind completed."); results in
From the same system I have been able to successfully bind against the server's TLS connection using JXplorer, and the domain matches the certificate. |
The "broken pipe" sounds like an OS-level error, e.g., an attempt to read a closed connection. To get a better idea what's happening, change the program to something like: let ldap = LdapConn::new(LDAP_SERVER).expect("handle");
ldap.simple_bind(LDAP_SERVICE_USER_DN, LDAP_SERVICE_USER_PW).expect("bind"); Run it with It would also help a) to know what kind of server are you connecting to, b) to have the most detailed server logs possible. |
Thank you very much - this identified the problem. I ran Is there a way to expose this tokio error to users of my application?
|
Excellent!
I don't think there is, presently. Handling this kind of error is one of tokio-proto's architectural loose ends, see the place in the code where it happens. |
Version 0.5.1 has just been published, with a TLS example from #15, so I'm going to close this. |
Is it possible to have an example of connecting to LDAPS? I've used v0.5.0 on crates.io and I'm struggling to find the correct way to build the connection. Thanks.
The text was updated successfully, but these errors were encountered: