Skip to content

Commit

Permalink
fix(url parser): default to ssl true for mongodb+srv
Browse files Browse the repository at this point in the history
  • Loading branch information
jlord committed Nov 22, 2017
1 parent 9e5d77e commit 0fbca4b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/url_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ module.exports = function(url, options, callback) {
}

if (result.protocol === 'mongodb+srv:') {
if (options) {
// TODO let the options passed in override
if (options.ssl && options.ssl !== true) {
options.ssl = true;
}
}
if (result.hostname.split('.').length < 3) {
return callback(new Error('uri does not have hostname, domainname and tld'));
}
Expand Down

0 comments on commit 0fbca4b

Please sign in to comment.