mirror of
https://github.com/lldap/lldap.git
synced 2026-04-25 16:25:55 +03:00
[GH-ISSUE #926] [BUG] 🚨 [error]: [LDAPS] Service Error: while handling incoming messages: while receiving LDAP op: unexpected end of file #335
Labels
No labels
backend
blocked
bug
cleanup
dependencies
docker
documentation
duplicate
enhancement
enhancement
frontend
github_actions
good first issue
help wanted
help wanted
integration
invalid
ldap
pull-request
question
rust
rust
tests
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/lldap-lldap#335
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @danthonywalker on GitHub (Jul 3, 2024).
Original GitHub issue: https://github.com/lldap/lldap/issues/926
Describe the bug
When trying to use the following command to test LLDAP:
ldapsearch -x -H ldaps://<IP> -D 'cn=user,ou=people,DC=example,DC=com' -w 'password' -b 'DC=example,DC=com'I get the error as specified in the titled.
ldapsearchprintsldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1).Meanwhile
ldapsearch -x -H ldap://<IP> -D 'cn=user,ou=people,DC=example,DC=com' -w 'password' -b 'DC=example,DC=com'Does work, so LLDAP is discoverable.
To Reproduce
I have this as my docker-compose:
Expected behavior
I expect LDAPS to work.
Logs
Additional context
I'm using NGINX Proxy Manager to obtain the certificate to a shared
letsencryptvolume. Both NPM and LLDAP are running in Portainer. Permissions should be good because they are both running as UID=1000 and GUID=1000.@nitnelave commented on GitHub (Jul 3, 2024):
Can you run
lldap checkhealth(or healthcheck?) from inside the container?That should tell you whether LDAPS is working. If it is, then maybe you have a reverse proxy in front of it that breaks the connection, or something like that
@danthonywalker commented on GitHub (Jul 3, 2024):
I do have a reverse proxy, but it's only pointing to the web UI component. Just to make sure though I'm hitting it with the IP of the host directly, but same result. As for the
checkhealth, exec'ing in the container when I runlldapI getcommand not found@danthonywalker commented on GitHub (Jul 3, 2024):
Nevermind, I figured it out.

./lldap healthcheckgives the following:So LDAPS is working, but
ldapsearchis not. I do not know why.@danthonywalker commented on GitHub (Jul 3, 2024):
Running with
-d1option:So the cert is considered untrusted, despite it being the same cert being used in my reverse proxy that's trusted by my browser.
@nitnelave commented on GitHub (Jul 3, 2024):
The certificate is bound to a domain name. If you access LDAPS directly by ip, it's not going to trust it.
There's an option to ldapsearch to disable certificate checking if you want. Otherwise, you need to query it through the domain.
@danthonywalker commented on GitHub (Jul 4, 2024):
Ignoring the certificate isn't really an option since I plan on integrating LLDAP with TrueNAS to allow SMB shares. This only works over LDAPS from what I understand.
I have this command:
ldapsearch -x -H ldaps://ldap.internal.example.com -D 'cn=admin,ou=people,DC=ldap,DC=internal,DC=example,DC=com' -w 'password' -b 'DC=ldap,DC=internal,DC=example,DC=com'Using
openssl x509 -noout -text -in fullchain.pemthe certificate has a singular subject of:CN=ldap.internal.example.comDomain, DN, and certificate subject all match...but still I get this error.
@danthonywalker commented on GitHub (Jul 4, 2024):
Okay I figured it out. I needed to install
libldap-commonwhich adds my computer's certificates as a part ofldap.conf. Thanking https://serverfault.com/a/1149381 for steering me in this direction.