Skip to content

Commit 0fbca4b

Browse files
committed
fix(url parser): default to ssl true for mongodb+srv
1 parent 9e5d77e commit 0fbca4b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/url_parser.js

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ module.exports = function(url, options, callback) {
1717
}
1818

1919
if (result.protocol === 'mongodb+srv:') {
20+
if (options) {
21+
// TODO let the options passed in override
22+
if (options.ssl && options.ssl !== true) {
23+
options.ssl = true;
24+
}
25+
}
2026
if (result.hostname.split('.').length < 3) {
2127
return callback(new Error('uri does not have hostname, domainname and tld'));
2228
}

0 commit comments

Comments
 (0)