Skip to content

fix: use correct ServerName for StartTLS - #195

Merged
harshavardhana merged 1 commit into
minio:mainfrom
ianroberts:fix/starttls-servername
Nov 15, 2025
Merged

harshavardhana merged 1 commit into
minio:mainfrom
ianroberts:fix/starttls-servername

Conversation

@ianroberts

Copy link
Copy Markdown
Contributor

When doing StartTLS for an LDAP server, the ServerName in the TLS config must match the actual host name to which we are connecting. The pre-configured l.TLS has the correct ServerName in the non-SRV case (where the configured host name is the LDAP server), but when using SRV lookups the configured name is the domain where we look for the SRV record, not the actual host to which we end up connecting.

To fix this, we need to adjust the TLS configuration to verify the certificate against the hostname we took from the SRV record, not the original name under which we found the SRV.

Fixes minio/minio#21202

@taran-p taran-p left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please update branch and fix shadowing issue, otherwise looks good

Comment thread ldap/ldap.go Resolved
When doing StartTLS, the ServerName in the TLS config must match the actual host name to which we are connecting.  The pre-configured l.TLS has the correct ServerName in the non-SRV case, but when connecting to servers whose names we found via an SRV lookup, we need to verify against the name from the SRV record, not the original name under which we found the SRV.

Fixes minio/minio#21202
@ianroberts
ianroberts force-pushed the fix/starttls-servername branch from 5622f87 to 612fa56 Compare November 15, 2025 09:23
@ianroberts
ianroberts requested a review from taran-p November 15, 2025 09:24
@harshavardhana
harshavardhana merged commit 1114611 into minio:main Nov 15, 2025
3 checks passed
@ianroberts
ianroberts deleted the fix/starttls-servername branch November 15, 2025 19:08
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

Successfully merging this pull request may close these issues.

Use of LDAP SRV records with TLS error

3 participants