Skip to content

fix(ldap): default to port 389 when startTLS is set - #5184

Merged
nabokihms merged 1 commit into
dexidp:masterfrom
SudeepGowda55:ldap-starttls-default-port
Nov 20, 2026
Merged

nabokihms merged 1 commit into
dexidp:masterfrom
SudeepGowda55:ldap-starttls-default-port

Conversation

@SudeepGowda55

Copy link
Copy Markdown
Contributor

Overview

When host has no port and startTLS: true, the connector defaulted to 636, so it sent a plain ldap:// connection to the LDAPS port. StartTLS runs on 389, which is also what the docs already say.

What this PR does / why we need it

Use 389 when either insecureNoSSL or startTLS is set, and add a test for the default port selection.

Refs #2351

Special notes for your reviewer

Explicit ports are unchanged.

Signed-off-by: sudeepgowda55 <ssudeepgowda55@gmail.com>
@nabokihms nabokihms added the release-note/bug-fix Release note: Bug Fixes label Nov 20, 2026

@nabokihms nabokihms left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM!

@nabokihms
nabokihms merged commit 7dec094 into dexidp:master Nov 20, 2026
3 checks passed
kuangruan pushed a commit to kuangruan/dex that referenced this pull request Nov 25, 2026
10 commits since 60f28dd: ID-JAG audience binding and auth_time, the
allowedGroups enforcement fix, ent blocked_until NULL handling, api
username validation, LDAP startTLS port default, implicit/hybrid fragment
encoding, and connector fixes. No changes are proposed upstream.

* 'master' of https://github.com/dexidp/dex:
  feat(oauth2): let an ID-JAG policy set the client's ID at each audience (dexidp#5181)
  feat(oauth2): carry auth_time from the subject token into the ID-JAG (dexidp#5180)
  fix(connector/github): return UserNotInRequiredGroupsError when user lacks org or team access (dexidp#5100)
  fix(storage/ent): store an unset blocked_until as NULL (dexidp#5163)
  fix(api): require a username in CreatePassword (dexidp#5162)
  fix(ldap): default to port 389 when startTLS is set (dexidp#5184)
  fix(server): don't double-encode the implicit and hybrid fragment (dexidp#5183)
  fix(oidc)!: enforce allowedGroups when insecureEnableGroups is unset (dexidp#5185)
  feat(server): allow starting without connectors when the connectors API is enabled (dexidp#5061)
  fix(server): type access tokens at+jwt for clients with an ID-JAG policy (dexidp#5179)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/bug-fix Release note: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants