fixed sslcapath bug

This commit is contained in:
LaysDragon 2017-11-28 21:23:50 +08:00
parent 8112cd6fef
commit 9949795533
2 changed files with 10 additions and 2 deletions

View file

@ -12,6 +12,6 @@ function getFile (path) {
module.exports = {
sslkeypath: getFile('/run/secrets/key.pem'),
sslcertpath: getFile('/run/secrets/cert.pem'),
sslcapath: getFile('/run/secrets/ca.pem'),
sslcapath: getFile('/run/secrets/ca.pem') !== undefined ? [getFile('/run/secrets/ca.pem')] : [],
dhparampath: getFile('/run/secrets/dhparam.pem')
}

View file

@ -95,7 +95,15 @@ config.isLDAPEnable = config.ldap.url
config.isPDFExportEnable = config.allowpdfexport
// generate correct path
config.sslcapath = path.join(appRootPath, config.sslcapath)
config.sslcapath = (function () {
var i, len, results
results = []
for (i = 0, len = config.sslcapath.length; i < len; i++) {
results.push(path.resolve(appRootPath, config.sslcapath[i]))
}
return results
})()
config.sslcertpath = path.join(appRootPath, config.sslcertpath)
config.sslkeypath = path.join(appRootPath, config.sslkeypath)
config.dhparampath = path.join(appRootPath, config.dhparampath)