@@ -1098,11 +1098,17 @@ var pluginManager = function pluginManager() {
1098
1098
var qstring = parts [ 1 ] ;
1099
1099
if ( qstring && qstring . length ) {
1100
1100
qstring = querystring . parse ( qstring ) ;
1101
- if ( qstring . ssl ) {
1101
+ if ( qstring . ssl && ( qstring . ssl === true || qstring . ssl === "true" ) ) {
1102
1102
ob . ssl = "" ;
1103
1103
ob . sslAllowInvalidCertificates = "" ;
1104
1104
ob . sslAllowInvalidHostnames = "" ;
1105
1105
}
1106
+ if ( qstring . tls && ( qstring . tls === true || qstring . tls === "true" ) ) {
1107
+ ob . tls = "" ;
1108
+ ob . tlsAllowInvalidCertificates = "" ;
1109
+ ob . tlsAllowInvalidHostnames = "" ;
1110
+ ob . tlsInsecure = "" ;
1111
+ }
1106
1112
if ( qstring . replicaSet ) {
1107
1113
ob . host = qstring . replicaSet + "/" + ob . host ;
1108
1114
}
@@ -1125,11 +1131,17 @@ var pluginManager = function pluginManager() {
1125
1131
else {
1126
1132
ob . host = ( config . mongodb . host + ':' + config . mongodb . port ) ;
1127
1133
}
1128
- if ( config . mongodb . serverOptions && config . mongodb . serverOptions . ssl ) {
1134
+ if ( config . mongodb . serverOptions && config . mongodb . serverOptions . ssl && ( config . mongodb . serverOptions . ssl === true || config . mongodb . serverOptions . ssl === "true" ) ) {
1129
1135
ob . ssl = "" ;
1130
1136
ob . sslAllowInvalidCertificates = "" ;
1131
1137
ob . sslAllowInvalidHostnames = "" ;
1132
1138
}
1139
+ if ( config . mongodb . serverOptions && config . mongodb . serverOptions . tls && ( config . mongodb . serverOptions . tls === true || config . mongodb . serverOptions . tls === "true" ) ) {
1140
+ ob . tls = "" ;
1141
+ ob . tlsAllowInvalidCertificates = "" ;
1142
+ ob . tlsAllowInvalidHostnames = "" ;
1143
+ ob . tlsInsecure = "" ;
1144
+ }
1133
1145
if ( config . mongodb . username && config . mongodb . password ) {
1134
1146
ob . username = config . mongodb . username ;
1135
1147
ob . password = utils . decrypt ( config . mongodb . password ) ;
@@ -1307,6 +1319,11 @@ var pluginManager = function pluginManager() {
1307
1319
}
1308
1320
catch ( ex ) {
1309
1321
logDbRead . e ( "Error connecting to database" , ex ) ;
1322
+ logDbRead . e ( "With params %j" , {
1323
+ db : db_name ,
1324
+ connection : dbName ,
1325
+ options : dbOptions
1326
+ } ) ;
1310
1327
//exit to retry to reconnect on restart
1311
1328
process . exit ( 1 ) ;
1312
1329
return ;
0 commit comments