-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Empty show more show less
-
Not Needed
What problem are you facing?
With driver 4.0 the srv resolution sets some connection options overriding what the user specifies directly in the connection string. In compass we verified that this applies for tls: true but could probably also affect those params that are taken from the TXT record: authSource, replicaSet and loadBalanced.
This seems to prevent users from connecting with srv+mongo with tls/ssl disabled in Compass and Mongodb for VSCode: https://jira.mongodb.org/browse/COMPASS-4928
Mongosh is not affected by this issue since srv records are resolved independently.
What driver and relevant dependency versions are you using?
4.0.0-beta.6
Steps to reproduce?
> require('mongodb/package.json').version "4.0.0-beta.6" > new (require('mongodb').MongoClient)('mongodb+srv://root:password123@srv-test.mongodb.dev/db1?ssl=false').connect(console.log) undefined > MongoServerSelectionError: Client network socket disconnected before secure TLS connection was established
3.6 used to connect:
> require('mongodb/package.json').version "3.6.9" > new (require('mongodb').MongoClient)('mongodb+srv://root:password123@srv-test.mongodb.dev/db1?ssl=false').connect(console.log) undefined > null MongoClient {_events: {…}, _eventsCount: 0, _maxListeners: undefined, s: {…}, topology: ReplSet}
On our side we would be happy with a workaround for now, but nothing that we tried seemed to work: tls:true as option for `MongoClient` is overridden and ssl:true only throws a different error:
new (require('mongodb').MongoClient)('mongodb+srv://root:password123@srv-test.mongodb.dev/db1?ssl=false', { ssl: false }).connect(console.log) connection_string.ts:367 Uncaught MongoParseError: All values of ssl must be the same.
- duplicates
-
NODE-3413 srv URLs ignore tls=
- Closed
- is depended on by
-
COMPASS-4928 SSL enabled with srv records even when SSL is set to none
- Closed