Skip to content

Commit 475e976

Browse files
fix(mongodb): respect MONGO_MTLS_VALIDATE variable (#158)
1 parent d7103e9 commit 475e976

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

infra/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ base.postgres = {
6262

6363
base.mongo = {
6464
uri: process.env.MONGO_URI || `mongodb://${APPLICATION_DOMAIN}/${name}`,
65+
/** @type {import('mongodb').MongoClientOptions} */
6566
options: {},
6667
};
6768

6869
if (process.env.MTLS_CERT_PATH) {
6970
base.mongo.options.tls = true;
7071
base.mongo.options.tlsCertificateKeyFile = process.env.MTLS_CERT_PATH;
72+
base.mongo.options.tlsInsecure = process.env.MONGO_MTLS_VALIDATE === 'false';
7173
}
7274

7375
base.logger = {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codefresh-io/service-base",
3-
"version": "5.0.3",
3+
"version": "5.0.4",
44
"main": "index.js",
55
"description": "",
66
"bin": {

0 commit comments

Comments
 (0)