As part of CLOUDP-25143, I am adding SRV support to Atlas. When creating an SRV record on AWS Route 53, the record looks as follows:
marko$ dig SRV _mongodb._tcp.marko-40x3z.mmscloudteam.com ; <<>> DiG 9.8.3-P1 <<>> SRV _mongodb._tcp.marko-40x3z.mmscloudteam.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19290 ;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;_mongodb._tcp.marko-40x3z.mmscloudteam.com. IN SRV ;; ANSWER SECTION: _mongodb._tcp.marko-40x3z.mmscloudteam.com. 59 IN SRV 0 0 27017 marko-shard-00-00-40x3z.mmscloudteam.com. _mongodb._tcp.marko-40x3z.mmscloudteam.com. 59 IN SRV 0 0 27017 marko-shard-00-01-40x3z.mmscloudteam.com. _mongodb._tcp.marko-40x3z.mmscloudteam.com. 59 IN SRV 0 0 27017 marko-shard-00-02-40x3z.mmscloudteam.com. _mongodb._tcp.marko-40x3z.mmscloudteam.com. 59 IN SRV 0 0 27017 marko-shard-00-03-40x3z.mmscloudteam.com.
When the shell builds the URI connection string from the target values of the SRV record, it appears as if it is not accounting for the trailing dot from the fully qualified domain names in the target DNS records:
marko$ ./mongo "mongodb+srv://marko-40x3z.mmscloudteam.com/test" --username marko --password MongoDB shell version v3.6.0-rc3 Enter password: connecting to: mongodb+srv://marko-40x3z.mmscloudteam.com/test 2017-11-14T11:55:57.657-0500 I NETWORK [thread1] Starting new replica set monitor for marko-shard-0/marko-shard-00-00-40x3z.mmscloudteam.com.:27017,marko-shard-00-01-40x3z.mmscloudteam.com.:27017,marko-shard-00-02-40x3z.mmscloudteam.com.:27017,marko-shard-00-03-40x3z.mmscloudteam.com.:27017 2017-11-14T11:55:57.820-0500 E NETWORK [ReplicaSetMonitor-TaskExecutor-0] The server certificate does not match the host name. Hostname: marko-shard-00-03-40x3z.mmscloudteam.com. does not match SAN(s): *.mmscloudteam.com mmscloudteam.com
We should remove the trailing dot from fully qualified domain names when parsing the target values for the DNS records.
- is related to
-
SERVER-31061 Make Mongo Shell handle `mongodb+srv://` style URIs
- Closed
- related to
-
CDRIVER-3043 valid_hostname() should not rejects strings with trailing dots
- Closed
-
DRIVERS-2057 Determine how drivers should handle trailing dots in SRV results
- Backlog