Conversation
Add a MongoClient-level `srvAllowedHostsSuffix` option that overrides the domain inferred from the SRV host name when validating the hosts returned by an SRV lookup. The value is normalized at configuration time (a leading "." is prepended if absent, so the stored and returned value always begins with "."), and every resolved host must end with it, matched case-insensitively; otherwise the existing inferred-domain validation is unchanged. The option is parsed from the connection string, carried on ClusterSettings, rejected on non-mongodb+srv URIs, rejected when it contains whitespace, no domain label, or an empty domain label, and threaded through the internal DNS resolution path. It is supported with both multi-server and load-balanced SRV connection strings, which now also apply srvServiceName consistently. JAVA-6233
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for
srvAllowedHostsSuffixusing the public suffix list as a deny list as a safeguard and add docs explaining the use of this parameter (and its potential security implications when used).