Commit 02816b68 authored by NGPixel's avatar NGPixel

fix: db inline CA cert reconstruct

parent 81732da7
......@@ -62,11 +62,16 @@ module.exports = {
}
// Handle inline SSL CA Certificate mode
if (!_.isEmpty(process.env.DB_SSL_CA) && process.env.DB_SSL_CA) {
if (!_.isEmpty(process.env.DB_SSL_CA)) {
const chunks = []
for (let i = 0, charsLength = process.env.DB_SSL_CA.length; i < charsLength; i += 64) {
chunks.push(process.env.DB_SSL_CA.substring(i, i + 64))
}
dbUseSSL = true
sslOptions = {
rejectUnauthorized: true,
ca: process.env.DB_SSL_CA
ca: '-----BEGIN CERTIFICATE-----\n' + chunks.join('\n') + '\n-----END CERTIFICATE-----\n'
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment