Skip to content
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

No TLS / STARTTLS with LDAP #146

Closed
Perflyst opened this issue Aug 18, 2019 · 4 comments
Closed

No TLS / STARTTLS with LDAP #146

Perflyst opened this issue Aug 18, 2019 · 4 comments

Comments

@Perflyst
Copy link

Currently it is not possible to use a local LDAP server, e.g. "url": "ldap://127.0.0.1"

First of all the error does not tell you that there is an issue with the encrypted connection

Error: Could not determine UUID for LDAP user.
Check that either uidNumber, uid or sAMAccountName is set in your LDAP directory or use another unique attribute and configure it using the "useridField" option in ldap settings.

Please add a way to connect "PLAIN" or accept the ssl certificate even if it is for another hostname.
Current workaround:
/etc/hosts
127.0.0.1 ldap.domain.tld

@alecdwm
Copy link
Contributor

alecdwm commented Aug 18, 2019

Hey @Perflyst!
Has your custom TLS cert been signed by some root ca?
If so, you should be able to specify the path to the root ca certificate as detailed here:
https://www.npmjs.com/package/passport-ldapauth#active-directory-over-ssl-example

{
  url: "ldaps://localhost",
  bindDN: "...",
  bindCredentials: "...",
  searchBase: "...",
  searchFilter: "...",
  searchAttributes: ["..."],
  tlsOptions: {
    ca: [
      fs.readFileSync("/path/to/root_ca_cert.crt")
    ]
  }
}

@Perflyst
Copy link
Author

I would say this does not matter here? It is not signed for localhost nor the IP address so CodiMD crashes because of this?

@alecdwm
Copy link
Contributor

alecdwm commented Aug 18, 2019

Ah. If you want to disable the verification of TLS certificates entirely, you could try:

{
  url: "ldaps://localhost",
  bindDN: "...",
  bindCredentials: "...",
  searchBase: "...",
  searchFilter: "...",
  searchAttributes: ["..."],
  tlsOptions: {
    rejectUnauthorized: false,
  }
}

@Perflyst
Copy link
Author

Perflyst commented Oct 2, 2019

Worked, thanks.

@Perflyst Perflyst closed this as completed Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants