Support mongodb+srv connection string in connection test tool#1841
Open
alcaeus wants to merge 2 commits intomongodb:v2.xfrom
Open
Support mongodb+srv connection string in connection test tool#1841alcaeus wants to merge 2 commits intomongodb:v2.xfrom
alcaeus wants to merge 2 commits intomongodb:v2.xfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for mongodb+srv:// connection strings to the connection test tool by implementing DNS SRV record resolution. Previously, the tool only supported standard mongodb:// connection strings and had a TODO comment for SRV support.
Changes:
- Implemented SRV record resolution via new
getHostsFromSrv()function - Added proper scheme validation and handling for both
mongodb://andmongodb+srv://protocols - Updated SSL detection logic to default to enabled for SRV connections per MongoDB specification
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v2.x #1841 +/- ##
=========================================
Coverage 87.91% 87.91%
Complexity 3208 3208
=========================================
Files 428 428
Lines 6390 6390
=========================================
Hits 5618 5618
Misses 772 772
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
810bcda to
f171efb
Compare
GromNaN
approved these changes
Feb 5, 2026
Member
GromNaN
left a comment
There was a problem hiding this comment.
Nice.
I'll let you decide how relevant these refactorings are.
Co-authored-by: Jérôme Tamarelle <jerome@tamarelle.net> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
I had GitHub Copilot implement this while I was busy with other things. I successfully tested this with one of my Atlas clusters.