Given a URI like this:
mongodb+srv://user:pass@hostname/test
If there is a TXT record for hostname like "authSource=admin", then the driver should log into the admin database, not the URI's database "test". However, the authSource from the TXT record is ignored.
Cause: when we create a client or client pool, we call mongoc_topology_new, which copies the client's URI to the topology's URI, then updates the topology's URI with the contents of the SRV and TXT records. But then we create a "cluster" using the client's URI, which hasn't been updated.
This is going to be a bug factory so I'll open a ticket to clean it up and test it better. Meanwhile, just initialize the cluster with the topology's URI, not the client's.
- is depended on by
-
DRIVERS-431 Test with authentication and mongodb+srv URI
-
- Closed
-
- is related to
-
CDRIVER-2426 Make fewer copies of the MongoDB URI
-
- Backlog
-
- related to
-
CDRIVER-3328 Provide a way to access the URI updated with TXT records from a mongoc_client_t
-
- Closed
-