[CDRIVER-4728] SRV URI should allow port number Created: 20/Sep/23 Updated: 27/Oct/23 Resolved: 21/Sep/23 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Minh Luu | Assignee: | Unassigned |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Description |
SummaryMongo C driver (libmongoc) currently does not allow port numbers with an SRV URI, and has an error that goes "Port numbers are prohibited in an SRV URI". The line of code is here. However, according to MongoDB official documentation, SRV URI can actually have port number. Could this be a Mongo C driver bug? Environment_Version of the C / CXX driver: All versions up to mongo-c-driver 1.24.4 The host OS, version, and architecture: All The C / CXX compiler and version: All MongoDB server version and topology (standalone, replica set, or sharded cluster): All How to ReproduceUse a MongoDB SRV URI (mongodb+srv://) which includes a port with the Mongo C Driver. Additional BackgroundPlease provide any additional background information that may be helpful in diagnosing the bug. |
| Comments |
| Comment by Minh Luu [ 21/Sep/23 ] | |||
|
I see, thank you for the clarification Kevin! I've opened DOCSP-33198 for this. | |||
| Comment by Kevin Albertson [ 20/Sep/23 ] | |||
|
minh.luu@mongodb.com thank you for the report. I expect "mongodb+srv" URIs to have one host, and no port. This is noted in the driver specification:
There may be more than one resolved SRV record, and the record includes a port. The test DNS records used by driver testing can be used to observe:
Results in these records:
I expect this is a documentation bug, and suggest filing a DOCSP ticket. |