Closed PentaPaetzold closed 1 year ago
you should upgrade to 2023.6.xx for startTLS
support
From the verbose logs it looks like the ldapsearch command tries to do StartTLS after connecting via SSL, which I don't think is actually supported (and also kinda redundant?)
You can basically remove the -Z
when using port 636, since
-Z[Z] Issue StartTLS (Transport Layer Security) extended operation. If you use -ZZ, the command will require the operation to be successful.
So Port 636 is always SSL- Encrypted also when not TLS- Handshake was successful? If thats true, this is fine.
Last: How do i get rid of Self-Signed- Certificates and use my letsencrpyt ones? In docker they are in another volume, but i could mount it to authentik somewhere, if i know how to use them there. Are there any docs?
found the docs. login is working, thank you very much!
@PentaPaetzold could you provide a bit more guidance/info on how you were able to get ldaps working? I've setup my LDAP so that ldapsearch is able to connect via port 389, but cannot figure out how to get SSL/port 636 going.
Is all that is needed to modify the LDAP provider? Are you using the authentik self-signed cert? What are you putting in 'TLS Server Name'? Are you using something like NGINX-PM to forward a domain/cert to your LDAP server?
Any info/help would be greatly appreciated!
@MasterKryszn Did you try ldapsearch as above? What does it tell?
For me it was the understanding difference between TLS and SSL.
SSL is establisched from the beginning of the Handshake before sending Data (at port 636). The Cert can either be Authentik self signed (is use by default) or set to some valid certificate - which i now use. Look at the certificates- section in the docs. If you import your lets'encrypt directory, they will be shown and be available and you can select the right one for your server.
You can check SSL certs and connection is doing fine by running:
openssl s_client -connect yourserver.site:636 -showcerts </dev/null
SSL has only one disadvantage: the certificate is fixed - you cannot use different ones if your server serves different domains, as the check will fail then.
This can be archived by TLS - you can connect at 389 Plaintext with at any domain and then it will do an TSL- Upgrade with the given Domain (by client). The parameter -ZZ in ldapsearch will force this upgrade to succeed and return error if it fails. Without -ZZ it will also connect - but the Data won't be encrypted!
It does not make sense to upgrade SSL- Connections by TLS. That is, why it would not work.
So my solution was, to use SSL only and disable TLS completely in the clients-setup. I also got SSSD Login working and now i am waiting impatiencly to have Kerberos- Support in Authentik, which would be Huge :) GL and HF
Describe your question/ Trying to get ldaps working (TLS/SSL).
Relevant infos I have setup up LDAP as written in https://goauthentik.io/docs/providers/ldap/generic_setup This is basically working, i am getting and list when i am connecting locally without ssl using
ldapsearch -x -H ldap://localhost:389 -D 'cn=testu123,ou=users,DC=authentik,DC=penta-home,DC=site' -w 'somethingsilly' -b 'DC=authentik,DC=penta-home,DC=site' '(objectClass=user)' -v
(btw - the docs for that command could be updated, as -h is not vaild any more and was replaced by -H) but if i do the same thing withldapsearch -ZZ -d 5 -b 'DC=authentik,DC=penta-home,DC=site' -s sub -D 'cn=testu123,ou=users,DC=authentik,DC=penta-home,DC=site' -H ldaps://authentik.penta-home.site:636 -w "somethingsilly" -x '(objectClass=user)' -x -LLL
i get ares_errno: 2, res_error: <Protocol Error>, res_matched: <>
see full logs beneath.maybe i have done something wrong with the parameters. I realised, that it does not make a difference which password i am using, so maybe the authentication itself is not working via ssl/tls as i am doing it right now?
-> And if i only use -Z instead of -ZZ it also works. But i am unsure, if the Connection is encrypted. Maybe this has to do something with self-signed certificate?
Could someone add the ssl- version of ldapsearch to the docs?
Last question would be how to use letsencypt certificates instead of the buildin self-signed ones of authentik?
Logs
Version and Deployment: